V2EX克隆項目升級Vue.js 1.x to 2.0

Demo: http://v2ex.liuzhen.me/html

項目地址: https://github.com/liuzhenang...vue

項目升級更新詳情: https://github.com/liuzhenang...git

升級步驟:

第一步, 安裝 vue-migration-helper CLI 工具,以幫助從Vue 1.x遷移到2.0。 它掃描文件以獲取Vue特定的代碼,並在找到過期的模式時提供詳細的警告。github

# install
npm install --global git://github.com/vuejs/vue-migration-helper.git

# navigate to a Vue 1.x project directory
cd path/to/my-vue-project

# scan all files in the current directory
vue-migration-helper
# scan all files in specific sub-directories
vue-migration-helper src folder-a folder-b

第二步, 根據提示信息修改文件中對應的地方.vue-router

Screenshot

另: v2ex_frontend 項目 1.0 引用了 vue-paginate, 這個package不支持 Vue.js 2.0, 目前已經刪除使用.npm

2.0 相關文檔

vue.js 2.0 中文文檔: http://vuefe.cn/guide/frontend

vue.js 2.0 英文文檔: http://rc.vuejs.org/guide/ins...ide

vue-router 2.0 文檔: http://router.vuejs.org工具

相關文章
相關標籤/搜索