回答編集履歴
2
公式ページ追加
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
v-forの中で記述されている labelタグのfor属性の値と、inputタグのid属性の値がすべてswitchになっているからです。
|
2
2
|
|
3
|
-
その
|
3
|
+
そこの部分を以下に変えてみてください。
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -15,3 +15,11 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
[動くサンプルです](https://stackblitz.com/edit/js-tnmnfp?file=index.html)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
属性バインディングとループ処理は基本なので公式サイトで確認されることをおすすめします。
|
22
|
+
|
23
|
+
[属性バインディング](https://jp.vuejs.org/v2/guide/syntax.html#%E5%B1%9E%E6%80%A7)
|
24
|
+
|
25
|
+
[ループ処理](https://jp.vuejs.org/v2/guide/list.html)
|
1
サンプル追加
test
CHANGED
@@ -11,3 +11,7 @@
|
|
11
11
|
<input type="checkbox" v-bind:id="'switch' + index" class="switch-display">
|
12
12
|
|
13
13
|
```
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
[動くサンプルです](https://stackblitz.com/edit/js-tnmnfp?file=index.html)
|