ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.06k stars 14.64k forks source link

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

Open lidingyuan opened 1 year ago

lidingyuan commented 1 year ago

Element UI version

2.15.10

OS/Browsers version

105.0.5195.127

Vue version

2.7.13

Reproduction Link

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不再响应

daylenjeez commented 1 year ago

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

pavel-lens commented 1 year ago

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