vue-cli项目生成

安装vue-cli

C:\Users\fei>npm install -g vue-cli
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coff
eescript" (no hyphen)
D:\nodes\node_cache\vue-init -> D:\nodes\node_cache\node_modules\vue-cli\bin\vue
-init
D:\nodes\node_cache\vue -> D:\nodes\node_cache\node_modules\vue-cli\bin\vue
D:\nodes\node_cache\vue-list -> D:\nodes\node_cache\node_modules\vue-cli\bin\vue
-list
+ [email protected]
added 239 packages in 79.481s

相关命令

  查看版本信息和帮助信息

C:\Users\fei>vue -V
2.9.6

C:\Users\fei>vue --help
Usage: vue <command> [options]

Options:
  -V, --version  output the version number
  -h, --help     output usage information

Commands:
  init           generate a new project from a template
  list           list available official templates
  build          prototype a new project
  create         (for v3 warning only)
  help [cmd]     display help for [cmd]

  查看模板信息

C:\Users\fei>vue list

  Available official templates:

  ★  browserify - A full-featured Browserify + vueify setup with hot-reload, li
nting & unit testing.
  ★  browserify-simple - A simple Browserify + vueify setup for quick prototypi
ng.
  ★  pwa - PWA template for vue-cli based on the webpack template
  ★  simple - The simplest possible Vue setup in a single HTML file
  ★  webpack - A full-featured Webpack + vue-loader setup with hot reload, lint
ing, testing & css extraction.
  ★  webpack-simple - A simple Webpack + vue-loader setup for quick prototyping
.
# 切换到指定目录

C:\Users\fei>cd E:\前端\vue\vue学习\第一个vue-cli项目

C:\Users\fei>e:

E:\前端\vue\vue学习\第一个vue-cli项目>

  项目生成

E:\前端\vue\vue学习\第一个vue-cli项目>vue init webpack-simple myProject

? Project name 01
? Project description A Vue.js project
? Author 张亚飞 <[email protected]>
? License MIT
? Use sass? No

   vue-cli · Generated "myProject".

   To get started:

     cd myProject
     npm install
     npm run dev

  

猜你喜欢

转载自www.cnblogs.com/zhangyafei/p/10276385.html