Skip to content
ygj6 edited this page Jun 25, 2021 · 3 revisions

暂时不受支持的API


依赖项

  • element-ui =>element-plus
  • 如果是cli的项目
    1. npm install @vue/cli-plugin-babel@next
    2. npm install @vue/cli-plugin-eslint@next
    3. npm install @vue/cli-service@next
  • 如果包含babel-eslint依赖
    1. npm remove babel-eslint
    2. npm install @babel/core@7.12.16(可以自行切换版本,这里只是示例)
    3. 更换解析器配置 "parserOptions":{"parser":"@babel/eslint-parser"}

Vue

  • 全局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


Element-ui

  • package.json 依赖切换成element-plus

  • import xxx from element-ui 切换成 import xxx from element-plus

  • v-popover指令展暂时不可用,可能是ElementPlus的bug,使用<template #reference>替代


I18N

  • new VueI18N(...) => createI18n(...)

Vue-Router

  • new Router(...) => createRouter(...)

  • 路径匹配中的*替换成/:pathMatch(.*)*

  • addRoutes(...)直接添加数组类型的方法移除,需要替换成addRoute(...)


Vuex

  • new Vuex.Store(...) => createStore(...)
Clone this wiki locally