我的 .vue 文件上有以下 Buefy 组件:
<button class="button is-dark alt-dark" slot="trigger">
<b-icon ref="bellIcon" pack="far" icon="bell" :class="{ 'has-update-mark' : false }"></b-icon>
</button>
我想删除“pack='far'属性,并更新该类设置为 true 的 json 对象。因此,我的 Buefy 组件将如下所示:
<button class="button is-dark alt-dark" slot="trigger">
<b-icon ref="bellIcon" icon="bell" :class="{ 'has-update-mark' : true }"></b-icon>
</button>
我试图删除包属性,如下所示:
this.$refs.bellIcon.pack = ""
但是我得到了以下错误:
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:
"pack"
所以,我不知道如何修改:类或包属性。如何在脚本中修改它们?尤其是 :类属性。当我检查“bellIcon”引用时,我甚至没有在对象列表中看到它。所以我真的最想要那个。谢谢
神不在的星期二
相关分类