Solvedelement [Bug Report] $attrs is readonly $listeners is readonly

Element UI version

1.4.7

OS/Browsers version

mac/chrome

Vue version

2.5.2

Reproduction Link

#7664

Steps to reproduce

开发环境,表格中的按钮点击时调用this. $confirm() 时,vue会报错:“$attrs is readonly 和 $listeners is readonly”;

What is Expected?

控制台不会弹出错误警告。

What is actually happening?

控制台有$attrs is readonly ,$listeners is readonly 两个错误警告,关闭的时候也会出现

23 Answers

✔️Accepted Answer

I use electron-vue and meet this issue too, there is a solution works for me, in webpack.render.config.js:

let whiteListedModules = ['vue'];

change to

let whiteListedModules = ['vue', 'element-ui'];

Other Answers:

我把Vue升级到了2.5.7依旧有这个问题

please , where is the webpack.renderer.config.js , building project by @vue-cli3 , I can't find webpack.renderer.config.js file.

i came upon a this issue too, because i use webpack DllPlugin, after i remove webpack DllPlugin, the issue resolved.

so may be the issue is not caused by Vue version, but some tools like webpack.

you can also see https://forum.vuejs.org/t/vue-warn-attrs-is-readonly/18053/8

The same issue here, which is vue@2.6.6 & iview@3.2.2. Using this method to solve the problem

let whiteListedModules = ['vue'];

change to

let whiteListedModules = ['vue', 'element-ui'];

More Issues: