【已解决】wangEditor报错$attrs is readonly.$listeners is readonly
在vue.config.js
中加上如下代码
const { defineConfig } = require('@vue/cli-service')
const path = require('path');
function resolve(dir) { //报resolve错的话加上这个方法return path.join(__dirname, dir);
}module.exports = defineConfig({chainWebpack: config => { // 处理wangEditor的报错问题config.resolve.alias.set('@', resolve('src')).set('vue', resolve('./node_modules/vue'))}
})
注意:改后重启项目!改后重启项目!改后重启项目!