Use returned value from toggle component on change event

This commit is contained in:
Hossein Nedaee
2019-10-22 23:04:17 +03:30
parent 3208cec882
commit cbbc0e5efa
3 changed files with 5 additions and 5 deletions

View File

@@ -92,8 +92,8 @@
methods: {
toggle() {
this.$refs.toggle.classList.toggle("on");
this.$emit('change', this.$refs.toggle.classList.contains("on"));
const containsOnClass = this.$refs.toggle.classList.toggle("on");
this.$emit('change', containsOnClass);
}
}