forked from vuejs/vue-codemod
-
Notifications
You must be signed in to change notification settings - Fork 21
Home
ygj6 edited this page Jun 25, 2021
·
3 revisions
- element-ui =>element-plus
- 如果是cli的项目
- npm install @vue/cli-plugin-babel@next
- npm install @vue/cli-plugin-eslint@next
- npm install @vue/cli-service@next
- 如果包含
babel-eslint
依赖- npm remove babel-eslint
- npm install @babel/[email protected](可以自行切换版本,这里只是示例)
- 更换解析器配置 "parserOptions":{"parser":"@babel/eslint-parser"}
-
全局API
Vue.config app.config Vue.config.ignoredElements app.config.compilerOptions.isCustomElement (see below) Vue.component app.component Vue.directive app.directive Vue.mixin app.mixin Vue.use app.use (see below) Vue.prototype app.config.globalProperties (see below) -
图片引入方式
require(imgPath)
=>import xxx from imgPath
-
package.json 依赖切换成element-plus
-
import xxx from element-ui
切换成import xxx from element-plus
-
v-popover
指令展暂时不可用,可能是ElementPlus的bug,使用<template #reference>
替代
-
new VueI18N(...)
=>createI18n(...)
-
new Router(...)
=>createRouter(...)
-
路径匹配中的*替换成/:pathMatch(.*)*
-
addRoutes(...)
直接添加数组类型的方法移除,需要替换成addRoute(...)
-
new Vuex.Store(...)
=>createStore(...)