fix(tree): fix every node @check-change event fire only once (#1390)

* fix(tree): fix every node @check-change event fire only once

fix every node @check-change event fire only once (修复每个node节点@check-change事件仅触发一次问题)

* fix(tree): fix node trigger check-change only once

Co-authored-by: 田梦圆 <tianmengyuan@tianmengyuan-2.local>
Co-authored-by: Ryan2128 <33176053+Ryan2128@users.noreply.github.com>
This commit is contained in:
wantMorePayMore 2021-01-30 22:11:53 +08:00 committed by GitHub
parent df5d2ac97a
commit aef2d8cc9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,7 +160,7 @@ export default defineComponent({
}
const handleSelectChange = (checked: boolean, indeterminate: boolean) => {
if (oldChecked.value !== checked && oldIndeterminate.value !== indeterminate) {
if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) {
tree.ctx.emit('check-change', props.node.data, checked, indeterminate)
}
oldChecked.value = checked