yarn global add @vue/cli
vue create 你的项目名
# 回车回车用yarn之类的选项了
# vue其实核心件:
yarn add vue-router vuex
# 前端全家福:
yarn add jquery bootstrap font-awesome popper.js vue-loader vue-html-loader vue-style-loader css-loader
# 验证、ajax请求、i18n翻译、cookies:
yarn add vee-validate vue-axios vue-i18n js-cookie
因为vue-cli3改变了项目结构,之前的配置文件方式改变了,需要自己新建几个文件
新建 .env、 .env.local 文件
在项目中,也就是src中使用环境变量的话,必须以VUE_APP_开头。例如我们可以在main.js中直接输出:console.log(process.env.VUE_APP_SECRET)
新建 vue.config.js 文件
yarn install
yarn run serve
yarn run build