vuejs3.0 从入门到精通——项目创建
项目创建
完成 Vue CLI 脚手架的安装后,即可快速构建一个全新 Vue.js 项目,包括可初始化项目的整体结构、依赖包、插件等相关工作。
一、命令构建项目
1.1、创建项目:
[root@JumperServer:project_vue] # vue create vue3-element-plus-admin Vue CLI v5.0.8 ? Please pick a preset: (Use arrow keys) ❯ Default ([Vue 3] babel, eslint) //默认 Vue3,仅安装 babel 和 eslint Default ([Vue 2] babel, eslint) Manually select features //自定义选项安装
选择:Default ([Vue 3] babel, eslint)
1.2、选择包管理工具:
Vue CLI v5.0.8 ? Please pick a preset: Default ([Vue 3] babel, eslint) ? Pick the package manager to use when installing dependencies: Yarn Vue CLI v5.0.8 ✨ Creating project in /zuoyang/project_vue/vue3-element-plus-admin. 🗃 Initializing git repository... ⚙️ Installing CLI plugins. This might take a while... yarn install v1.22.19 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... success Saved lockfile. Done in 18.39s. 🚀 Invoking generators... 📦 Installing additional dependencies... yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. Done in 4.75s. ⚓ Running completion hooks... 📄 Generating README.md... 🎉 Successfully created project vue3-element-plus-admin. 👉 Get started with the following commands: $ cd vue3-element-plus-admin $ yarn serve [root@JumperServer:project_vue] #
1.3、启动服务:
[root@JumperServer:project_vue] # cd vue3-element-plus-admin/ [root@JumperServer:vue3-element-plus-admin] # yarn serve yarn run v1.22.19 warning ../../package.json: No license field $ vue-cli-service serve INFO Starting development server... DONE Compiled successfully in 3545ms 11:26:54 AM App running at: - Local: http://localhost:8080/ - Network: http://10.230.192.72:8080/ Note that the development build is not optimized. To create a production build, run yarn build.