提交 f468cf20 编写于 作者: B bayanxing

codecheck问题修改

Signed-off-by: Nbayanxing <bayanxing@kaihongdigi.com>
上级 84d102b5
......@@ -7,7 +7,7 @@
<text class="margin">2. Single choice example</text>
<div style="flex-wrap: wrap">
<toggle class="margin toggle2" for="{{toggle_List}}" id="{{$item.id}}" checked="{{$item.checked}}"
<toggle class="margin toggle2" for="{{toggleList}}" id="{{$item.id}}" checked="{{$item.checked}}"
value="{{$item.name}}" @change="allchange" @click="allclick({{$item.id}})"></toggle>
</div>
......@@ -18,7 +18,7 @@
<text class="margin">4. Single choice example</text>
<div style="flex-wrap: wrap">
<toggle class="margin toggle4" for="{{toggle_List}}" id="{{$item.id}}" checked="{{$item.checked}}"
<toggle class="margin toggle4" for="{{toggleList}}" id="{{$item.id}}" checked="{{$item.checked}}"
value="{{$item.name}}" @change="allchange" @click="allclick({{$item.id}})"></toggle>
</div>
......@@ -30,7 +30,7 @@
<text class="margin margin5">6. Single</text>
<div style="flex-wrap: wrap">
<toggle class="margin toggle6" for="{{toggle_List}}" id="{{$item.id}}" checked="{{$item.checked}}"
<toggle class="margin toggle6" for="{{toggleList}}" id="{{$item.id}}" checked="{{$item.checked}}"
value="{{$item.name}}" @change="allchange" @click="allclick({{$item.id}})"></toggle>
</div>
</div>
......
......@@ -15,7 +15,7 @@
export default {
data: {
toggle_List: [
toggleList: [
{ "id":"1001", "name":"Living room", "checked":true },
{ "id":"1002", "name":"Bedroom", "checked":false },
{ "id":"1003", "name":"Second bedroom", "checked":false },
......@@ -30,10 +30,10 @@ export default {
allchange(e) {
if (e.checked === true) {
for (var i = 0; i < this.toggle_list.length; i++) {
if (this.toggle_List[i].id === this.idx) {
this.toggle_List[i].checked = true
if (this.toggleList[i].id === this.idx) {
this.toggleList[i].checked = true
} else {
this.toggle_List[i].checked = false
this.toggleList[i].checked = false
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册