vue-cli初接触

在用 Vue 构建大型应用时推荐使用 NPM 安装。NPM 能很好地和诸如 webpack 或 Browserify 模块打包器配合使用。同时 Vue 也提供配套工具来开发单文件组件。

# 最新稳定版
$ npm install vue

在选择目录下创建项目名,输入项目名,描述,作者,构建项选择runtime+Compiler,是否安装路由,是否使用ESLink规范代码,是否测试。

vue init webpack 项目名

? Project name todolist
? Project description A Vue.js project
? Author ssx
? Vue build (Use arrow keys)
? Vue build standalone
? Install vue-router? No
? 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 after the project has been created? (recommended) npm

启动项目

cd todolist
npm run dev

默认端口,localhost:8080.

原文地址:https://www.cnblogs.com/nirvanaInSilence/p/12936748.html