Skip to content

Commit bebac9c

Browse files
authored
Merge pull request #3 from codeages-design/feature/modify-switch
更新switch使用方式示例
2 parents 9855d37 + ae29137 commit bebac9c

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" checked />
26+
</label>
27+
1728
// 为了避免和js中的switch关键词冲突,故用onoff
1829
cd.onoff({
1930
el: '#switch'

0 commit comments

Comments
 (0)