vue-cli搭建vue开发环境

前置环境

npm install -g vue-cli

vue list

已安装环境后:

vue init webpack sell 建立项目名称sell
------------------------------------------------------------------------
? Project name sell
? Project description A Vue.js project
? Author sangzesheng <sangzesheng@126.com>
? Vue build standalone 默认
? Install vue-router? No no
? Use ESLint to lint your code? Yes ES语法
? Pick an ESLint preset Standard 默认
? Setup unit tests with Karma + Mocha? No 单元测试no
? Setup e2e tests with Nightwatch? No no
------------------------------------------------------------------------
vue-cli · Generated "sell".

To get started:

cd sell
npm install
npm run dev

Documentation can be found at https://vuejs-templates.github.io/webpack

------------------------------------------------------------------------
cd sell 进入项目目录
dir 查看基本项目目录结构

npm install 安装依赖
dir 查看依赖安装是否成功,多出node_modules目录。

npm run dev 安装运行端口
------------------------------------------------------------------------
> sell@1.0.0 dev C:UsersAdministratorsell
> node build/dev-server.js

> Starting dev server...

DONE Compiled successfully in 5623ms

> Listening at http://localhost:8080 浏览器默认打开页面http://localhost:8080/,显示正常即创建完毕。

原文地址:https://www.cnblogs.com/sangzs/p/8575313.html