vue项目创建:**
1.打开指定文件夹,在路径上输入cmd回车打开黑窗口,这样就可以在当前路径下创建vue项目。
2.输入创建vue项目的命令: vue create [项目名]
3.项目配置:
选择:Manually select features
三种不同项目的对应选项:
a)基本项目:
选中:Choose Vue version
b)带路由的项目:
选中:Choose Vue version
选中:Router
c)带vuex的项目:
选中:Choose Vue version
选中:Vuex
Choose a version of Vue.js that you want to start the project with
选择:3.x
Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
选择:In dedicated config files
Save this as a preset for future projects?
选择:N
是否使用历史版本中的路由:
如果没有vue选项,黑窗口运行:npm install vuex --save
创建项目:(命名不要使用中文)
1.基础项目 vueproject
2.带路由的项目 routerproject vue create chengliyou
3.带vuex的项目 vuexproject vue create chengvuex
4.带路由和vuex的项目 routervuex vue create chengvuexlu
运行项目指令 npm run serve