小编Agu*_*ros的帖子

从 element-ui 迁移到 Element-plus

我在 Vue2 中进行项目并使用 element-ui,但我们想将项目升级到 Vue3。为此,我们需要传递 Element-plus(element-ui 与 Vue3 不兼容)。

我们成功地传递了 Vue3,但是当我们想要使用 element comp 时,我们总是遇到相同的问题。控制台中出现错误,我不明白为什么。我怀疑使用 vue-loader 将我的 SFC 文件转换为渲染器函数时出现问题。

我的测试页面:

<template>
  <div id="app">
    <el-date-picker
      v-model="value1"
      type="date"
      placeholder="Pick a day"
    />
  </div>
</template>

<script>
const default_layout = "default";

export default {
    name: "App",
    components: {
    },
    data() {
        return {
            value1: null
        };
    },
Run Code Online (Sandbox Code Playgroud)

vue.config.js:

module.exports = {
    lintOnSave: false,
    chainWebpack: config => {
        config.resolve.alias.set("vue", "@vue/compat");
        config.module
            .rule("vue")
            .use("vue-loader")
            .tap(options => {
                return {
                    ...options,
                    compilerOptions: {
                        compatConfig: {
                            MODE: 2
                        } …
Run Code Online (Sandbox Code Playgroud)

javascript migration vuejs3 element-plus

5
推荐指数
0
解决办法
907
查看次数

标签 统计

element-plus ×1

javascript ×1

migration ×1

vuejs3 ×1