We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent befb240 commit 5982ebeCopy full SHA for 5982ebe
src/components/VueToggle.vue
@@ -1,15 +1,8 @@
1
<template>
2
- <section class="wrapper">
3
- <input
4
- :id="id"
5
- v-model="toggled"
6
- :name="name"
7
- class="toggle"
8
- type="checkbox"
9
- @click="toggle()"
10
- />
+ <section class="wrapper" :title="title">
+ <input :id="id" :name="name" v-model="toggled" class="toggle" type="checkbox" @click="toggled = !toggled" />
11
<label :for="id" class="toggler" />
12
- <span class="title" @click="toggle()" v-text="title" />
+ <span class="title" v-text="title" @click="toggled = !toggled" />
13
</section>
14
</template>
15
@@ -27,12 +20,6 @@ export default {
27
20
data() {
28
21
return { toggled: false }
29
22
},
30
-
31
- methods: {
32
- toggle() {
33
- this.toggled = !this.toggled
34
- },
35
36
23
}
37
24
</script>
38
25
0 commit comments