Vue 安裝及使用

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

更多資料

vuejs中文官方文檔

Vue.js 入門教程

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章