chore: make method event independent (#719)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/719 Co-authored-by: dpschen <dpschen@noreply.kolaente.de> Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
0ed3cf2553
commit
d0e46e59e8
1 changed files with 5 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
||||||
:checked="checked"
|
:checked="checked"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:id="checkBoxId"
|
:id="checkBoxId"
|
||||||
@change="updateData"
|
@change="(event) => updateData(event.target.checked)"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
type="checkbox"/>
|
type="checkbox"/>
|
||||||
<label :for="checkBoxId" class="check">
|
<label :for="checkBoxId" class="check">
|
||||||
|
@ -51,10 +51,10 @@ export default {
|
||||||
this.checkBoxId = 'fancycheckbox' + Math.random()
|
this.checkBoxId = 'fancycheckbox' + Math.random()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateData(e) {
|
updateData(checked) {
|
||||||
this.checked = e.target.checked
|
this.checked = checked
|
||||||
this.$emit('input', this.checked)
|
this.$emit('input', checked)
|
||||||
this.$emit('change', e.target.checked)
|
this.$emit('change', checked)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue