Vue.js 环境安装

安装 nodejs

https://nodejs.org/en/

切换到 taobao 的 npm 镜像

PowerShell 中执行如下命令,使用 taobao 镜像

npm install nrm -g --registry=https://registry.npm.taobao.org
nrm use taobao
nrm ls
npm install cnpm -g
  

安装 vue-cli

cnpm install -g vue-cli
vue
  

生成项目结构

vue init webpack firstVue
  

之后根据提示设置

启动命令

cd firstVue
npm install
npm run dev
  

部署

npm run build
  

将 dist 目录的文件打包上传到服务器根目录即可