Vue 安裝
使用 npm 安裝 vue:
npm install vue -g --registry=https://registry.npm.taobao.org
使用 npm 安裝 vue-cli:
# 全局安裝 vue-cli
npm install --global vue-cli -g --registry=https://registry.npm.taobao.org
體驗Vue項目
執行
# 創建一個基於 webpack 模板的新項目
vue init webpack my-project
vue-cli · Generated "my-project".
To get started:
cd my-project
npm install
npm run dev
命令後,就可http://localhost:8080/訪問了。
Build Setup
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test