前言
网上关于 $attrs is readonly 、 $listeners is readonly 的问题太多太多了,几乎全是无效的。
在 vue / nuxt 项目中,引入WangEditor V5 富文本编辑器后报错$attrs is readonly. | $listeners is readonly. | Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “value” 详细解决方案。
这个时候,页面确实出来了富文本编辑器,功能也正常使用,
但打开控制台一看,一串连环报错,包括但不限于以下 3 个错误:
- $attrs is readonly.
- $listeners is readonly.
- Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “value”