Skip to content

Commit 30b720c

Browse files
author
LianJion
committed
fix: switch使用方式
1 parent 406523e commit 30b720c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/views/component/switch.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@ export const switch_disabled = `
1313
</label>
1414
`;
1515

16+
1617
export const switch_api = `
18+
<!-- 1 无需js调用方式 即DATA-API -->
19+
<label class="cd-switch checked">
20+
<input type="radio" data-toggle="cd-switch" value="1" checked/>
21+
</label>
22+
23+
<!-- 2 js调用方式 -->
24+
<label class="cd-switch disabled">
25+
<input id="switch" type="radio" value="1" disabled />
26+
</label>
27+
1728
// 为了避免和js中的switch关键词冲突,故用onoff
1829
cd.onoff({
1930
el: '#switch'

0 commit comments

Comments
 (0)