[bugfix] Checkbox: should not prevent click event

This commit is contained in:
陈嘉涵
2019-05-07 15:41:34 +08:00
parent 6d0b5e5a0d
commit ecadb5d1e7
3 changed files with 18 additions and 6 deletions

View File

@@ -30,7 +30,15 @@ export default sfc({
methods: {
toggle() {
this.checked = !this.checked;
const checked = !this.checked;
// When toggle method is called multiple times at the same time,
// only the last call is valid.
// This is a hack for usage inside Cell.
clearTimeout(this.toggleTask);
this.toggleTask = setTimeout(() => {
this.checked = checked;
});
},
onClickIcon() {