提交 c0c37be4 编写于 作者: B bayanxing

codecheck问题修改

Signed-off-by: Nbayanxing <bayanxing@kaihongdigi.com>
上级 8e295b91
<div class="container">
<qrcode value="{{qr_value}}" type="{{qr_type}}"
style="color: {{qr_col}};background-color: {{qr_bcol}};width: {{qr_size}};height: {{qr_size}};margin-bottom: 70px;"></qrcode>
<qrcode value="{{qr_Value}}" type="{{qr_Type}}"
style="color: {{qr_Col}};background-color: {{qr_BCol}};width: {{qr_Size}};height: {{qr_Size}};margin-bottom: 70px;"></qrcode>
<text class="txt">Type</text>
<switch showtext="true" checked="true" texton="rect" textoff="circle" onchange="settype"></switch>
<text class="txt">Color</text>
<select onchange="setcol">
<option for="{{col_list}}" value="{{$item}}">{{$item}}</option>
<option for="{{col_List}}" value="{{$item}}">{{$item}}</option>
</select>
<text class="txt">Background Color</text>
<select onchange="setbcol">
<option for="{{bcol_list}}" value="{{$item}}">{{$item}}</option>
<option for="{{bCol_List}}" value="{{$item}}">{{$item}}</option>
</select>
</div>
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
data: {
qr_type: 'rect',
qr_size: '300px',
qr_col: '#87ceeb',
col_list: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'],
qr_bcol: '#f0ffff',
bcol_list: ['#f0ffff','#ffffe0','#d8bfd8']
qr_Type: 'rect',
qr_Size: '300px',
qr_Col: '#87ceeb',
col_List: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'],
qr_BCol: '#f0ffff',
bCol_List: ['#f0ffff','#ffffe0','#d8bfd8']
},
settype(e) {
if (e.checked) {
this.qr_type = 'rect'
this.qr_Type = 'rect'
} else {
this.qr_type = 'circle'
this.qr_Type = 'circle'
}
},
setvalue(e) {
this.qr_value = e.newValue
this.qr_Value = e.newValue
},
setcol(e) {
this.qr_col = e.newValue
this.qr_Col = e.newValue
},
setbcol(e) {
this.qr_bcol = e.newValue
this.qr_BCol = e.newValue
}
}
\ No newline at end of file
......@@ -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="{{toggle_List}}" 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="{{toggle_List}}" 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="{{toggle_List}}" 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: [
toggle_List: [
{ "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.toggle_List[i].id === this.idx) {
this.toggle_List[i].checked = true
} else {
this.toggle_list[i].checked = false
this.toggle_List[i].checked = false
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册