Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/views/component/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ export const switch_disabled = `
</label>
`;


export const switch_api = `
<!-- 1 无需js调用方式 即DATA-API -->
<label class="cd-switch checked">
<input type="radio" data-toggle="cd-switch" value="1" checked/>
</label>

<!-- 2 js调用方式 -->
<label class="cd-switch disabled">
<input id="switch" type="radio" value="1" checked />
</label>

// 为了避免和js中的switch关键词冲突,故用onoff
cd.onoff({
el: '#switch'
Expand Down