如今的項目是定死的依賴如下幾個核心組件的版本:vue
vue 2.3.3npm
element-ui 1.4.8element-ui
vue-template-comiler 2.3.3json
將之前定死的依賴修改成segmentfault
vue ^2.3.3app
element-ui ^1.4.8post
vue-template-comiler ^2.3.3ui
而後安裝npm-check-updates.net
npm install -g npm-check-updatescomponent
#執行版本升級檢查
npm-check-updates
#更新package.json
ncu -u
#從新安裝依賴
npm install
其它修改的點:
[Element Migrating][ElDialog][Attribute]: size is removed.
icon="search" --> suffix-icon="el-icon-search"
<template scope="scope"> --> <template slot-scope="scope">
導入components要使用import:
components: {
'orgPickerForm': require('@/components/orgPickerForm.vue'),
'userProject': require('./_userProject.vue'),
'projectDialogPicker': require('@/components/projectDialogPicker.vue')
}
調整爲:
import orgPickerForm from '@/components/orgPickerForm.vue'
import userProject from './_userProject.vue'
import projectDialogPicker from '@/components/projectDialogPicker.vue'
components: {
'orgPickerForm': orgPickerForm,
'userProject': userProject,
'projectDialogPicker': projectDialogPicker
}
參考資料:
https://segmentfault.com/a/1190000008742240
Element-ui升級2.0後初體驗
https://segmentfault.com/a/1190000012051823
Vue.js 2 遇到 vue.runtime.common.js?d43f:511 [Vue warn]: Failed to mount component: template or render function not defined. (found in root instance) 錯誤的解決方法。
http://blog.csdn.net/zhangchao19890805/article/details/53367574
http://blog.csdn.net/kang389110772/article/details/72896988