element [Bug Report] el-button组件disabled属性处理异常

ryhaxcpt  于 2023-02-04  发布在  其他
关注(0)|答案(2)|浏览(244)

Element UI version

2.15.10

OS/Browsers version

105.0.5195.127

Vue version

2.7.13

https://codepen.io/LIDINGYUAN/pen/zYaqLwb

Steps to reproduce

点击click me 按钮 should be disabled按钮应是disabled状态

What is Expected?

正常disabled

What is actually happening?

el-button组件复用时由于
buttonDisabled() {
return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
}
此计算属性在首次依赖收集时未收集到this.disabled依赖,导致buttonDisabled对this.disabled不再响应

e4eetjau

e4eetjau1#

可以通过给 button 加唯一的key解决

h79rfbju

h79rfbju2#

👍 I confirm the bug, happens also on Vue v2.6.14 and also Vue v2.7.14 (last version as of today)

相关问题