控制台输入:vue list
就会到展示模板:
★ browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.
★ browserify-simple- A simple Browserify + vueify setup for quick prototyping.
★ 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, linting, testing & css extraction.
★ webpack-simple- A simple Webpack + vue-loader setup for quick prototyping.
f:潭州学院vue学习resource>vue init webpack stuDemo
'git' ڲⲿҲǿеij
ļ
? Project name y
? Project description study
? Author chenjh
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you afterthe project has been created? (recommended) no
vue-cli · Generated "stuDemo".
# Project initialization finished!# ========================
To get started:
cd stuDemo
npm install (orifusing yarn: yarn)
npm run lint -- --fix (or for yarn: yarn run lint --fix)
npm run dev
Documentation can be found athttps://vuejs-templates.github.io/webpack
说明我们构建目录已经成功了。
说明:
cd 目录(你要把项目放在哪个目录);
vue init webpack pname(你的项目名字);
? Project description (A Vue.js project) vue-cli新建项目(项目描述);
? Author (xhdx ) ;zhuming3834@sina.com(项目作者);
? Vue build
❯ Runtime + Compiler: recommended for most users
Runtime-only: about 6KB lighter min+gzip, but templates (orany Vue-specific HTML) are ONLY allowed in .vue files - render functions are required elsewhere
这里选择Runtime + Compiler: recommended for most users;
? Install vue-router? (Y/n) y 是否使用vue-router,这里根据需求选择;
? Use ESLint to lint your code? (Y/n) y 是否使用ESLint,这里根据需求选择;
? Pick an ESLint preset (Use arrow keys)
❯ Standard (https://github.com/feross/standard)
Airbnb (https://github.com/airbnb/Javascript) none (configure it yourself) 这里选择Standard (https://github.com/feross/standard)
? Setup unit tests with Karma + Mocha? (Y/n) n 是否需要单元测试,这里根据需求选择;
Setup e2e tests with Nightwatch? (Y/n) n是否需要单元测试,这里根据需求选择;
cd pname(项目目录);
npm install 安装依赖;
npm run dev 本地运行项目