mirror of https://github.com/ElemeFE/element
Checkbox: fix change event param
parent
2b5efef3fa
commit
85a8ea0ade
|
@ -14,4 +14,5 @@ cp -rf ../../examples/element-ui/** $SUB_FOLDER/
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# deploy domestic site
|
# deploy domestic site
|
||||||
faas deploy alpha
|
faas deploy alpha
|
||||||
|
rm -rf temp_web
|
|
@ -165,9 +165,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChange(ev) {
|
handleChange(ev) {
|
||||||
|
if (this.isLimitExceeded) return;
|
||||||
|
let value;
|
||||||
|
if (ev.target.checked) {
|
||||||
|
value = this.trueLabel === undefined ? true : this.trueLabel;
|
||||||
|
} else {
|
||||||
|
value = this.falseLabel === undefined ? false : this.falseLabel;
|
||||||
|
}
|
||||||
|
this.$emit('change', value, ev);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.isLimitExceeded) return;
|
|
||||||
this.$emit('change', this.model, ev);
|
|
||||||
if (this._checkboxGroup) {
|
if (this._checkboxGroup) {
|
||||||
this.dispatch('ElCheckboxGroup', 'change', [this._checkboxGroup.value]);
|
this.dispatch('ElCheckboxGroup', 'change', [this._checkboxGroup.value]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="el-checkbox-group" role="group" aria-label="checkbox-group">
|
<div class="el-checkbox-group" role="group" aria-label="checkbox-group">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -176,9 +176,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChange(ev) {
|
handleChange(ev) {
|
||||||
|
if (this.isLimitExceeded) return;
|
||||||
|
let value;
|
||||||
|
if (ev.target.checked) {
|
||||||
|
value = this.trueLabel === undefined ? true : this.trueLabel;
|
||||||
|
} else {
|
||||||
|
value = this.falseLabel === undefined ? false : this.falseLabel;
|
||||||
|
}
|
||||||
|
this.$emit('change', value, ev);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.isLimitExceeded) return;
|
|
||||||
this.$emit('change', this.model, ev);
|
|
||||||
if (this.isGroup) {
|
if (this.isGroup) {
|
||||||
this.dispatch('ElCheckboxGroup', 'change', [this._checkboxGroup.value]);
|
this.dispatch('ElCheckboxGroup', 'change', [this._checkboxGroup.value]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue