Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加input双向绑定数据通知判断,目的防止在生成页面后手动更改input原生属性(去除disabled、readonly)变成可修改 #22819

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/input/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@
// should remove the following line when we don't support IE
if (event.target.value === this.nativeInputValue) return;

this.$emit('input', event.target.value);
if (!this.disabled && !this.readonly) {
Copy link
Contributor

@wangdaodao wangdaodao Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

计算属性里面有inputDisabled
如果把disabled替换成inputDisabled是不是会好一点?
另外,表单类组件Radio,Checkbox等这些应该也会存在同样的问题。

this.$emit('input', event.target.value);
}

// ensure native input value is controlled
// see: https://github.com/ElemeFE/element/issues/12850
Expand Down