實作簡單的計數器。
以 Vue 為基礎,
Vue-router 實現 SPA (Single Page Application),
Vuex 讓資料傳遞更方便。
範例參考 Vuex
使用 Yarn 管理套件,Speed Up Up 、套件版本統一。
如果還沒安裝 Yarn,執行:
curl -o- -L https://yarnpkg.com/install.sh | bash
Upgrade to vue 2.0.
# install dependencies
yarn
# serve with hot reload at localhost:8080
yarn run dev
# build for production with minification
yarn run build
For detailed explanation on how things work, checkout the guide and docs for vue-loader.