ElemeFE / ElemeFE/element

[BUG report]The callback attribute in element conflicts!!!!!!

Open
#21,311 1 comment 0 reactions 0 assignees View on GitHub
need: repro
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Element UI version
2.15.6

### OS/Browsers version
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36

### Vue version
2.6.14

### Reproduction Link
https://jsfiddle.net/aaaaa/

### Steps to reproduce
如果在html中使用了el-input等组件,那将会导致其他位置使用过callback属性的代码都报错
例如:
HTML:

javastrap:
var data = {
name: "name",
callback: function (response) {
console.log(response)
}
}
在运行时,会出现callback属性错误提示

### What is Expected?
我理解的callback作用域不一样,应该不会导致这种问题。
在示例中的callback仅为对象里面的一个属性

### What is actually happening?
实际上callback影响了全局,代表全局所有除开Element组件之外的地方将无法使用这个变量

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.