Functional bool setting

This commit is contained in:
Jiiks 2018-02-05 15:57:41 +02:00
parent 6a96ce1237
commit c5a011012f
1 changed files with 8 additions and 3 deletions

View File

@ -12,7 +12,7 @@
<div class="bd-setting-switch"> <div class="bd-setting-switch">
<div class="bd-title"> <div class="bd-title">
<h3>{{setting.text}}</h3> <h3>{{setting.text}}</h3>
<label class="bd-switch-wrapper"> <label class="bd-switch-wrapper" @click="toggle">
<input type="checkbox" class="bd-switch-checkbox" /> <input type="checkbox" class="bd-switch-checkbox" />
<div class="bd-switch" :class="{'bd-checked': setting.value}" /> <div class="bd-switch" :class="{'bd-checked': setting.value}" />
</label> </label>
@ -22,6 +22,11 @@
</template> </template>
<script> <script>
export default { export default {
props: ['setting', 'change'] props: ['setting', 'change'],
methods: {
toggle() {
this.change(this.setting.id, !this.setting.value);
}
}
} }
</script> </script>