vue-cli 上手

  
1.cnpm install --global vue-cli 安装脚手架

vue

2.vue init webpack baoge 建立webpack

3.选择配置项
web

    • Project name (baoge): -----项目名称,直接回车,按照括号中默认名字(注意这里的名字不能有大写字母,若是有会报错Sorry, name can no longer contain capital letters),
    • Project description (A Vue.js project): ----项目描述,也可直接点击回车,使用默认名字
    • Author (): ----做者,输入你的大名
      接下来会让用户选择:
    • Runtime + Compiler: recommended for most users 运行加编译,既然已经说了推荐,就选它了
      Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specificHTML) are ONLY allowed in .vue files - render functions are required elsewhere 仅运行时,已经有推荐了就选择第一个了
    • Install vue-router? (Y/n) 是否安装vue-router,这是官方的路由,大多数状况下都使用,这里就输入“y”后回车便可。
    • Use ESLint to lint your code? (Y/n) 是否使用ESLint管理代码,ESLint是个代码风格管理工具,是用来统一代码风格的,通常项目中都会使用。
      接下来也是选择题Pick an ESLint preset (Use arrow keys) 选择一个ESLint预设,编写vue项目时的代码风格,直接y回车
    • Setup unit tests with Karma + Mocha? (Y/n) 是否安装单元测试,我选择安装y回车
    • Setup e2e tests with Nightwatch(Y/n)? 是否安装e2e测试 ,我选择安装y回车

 

4.相关配置项解释 
https://blog.csdn.net/wulala_hei/article/details/80488674vue-router

相关文章
相关标签/搜索