Skip to content

Commit 788686b

Browse files
authored
Merge pull request #1 from codeages-design/bugfix/switch-click
修复switch无法切换
2 parents db6bfc3 + ac2bd2e commit 788686b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/views/component/switch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const switch_base = `
22
<label class="cd-switch checked">
3-
<input type="checkbox" data-toggle="cd-switch" value="1" checked/>
3+
<input id="switch" type="checkbox" data-toggle="cd-switch" value="1" checked/>
44
</label>
55
`;
66

src/views/component/switch.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ export default {
9696
}
9797
},
9898
mounted() {
99-
99+
cd.onoff({
100+
el: '#switch'
101+
}).on('change', (value) => {
102+
console.log('switch', value);
103+
})
100104
},
101105
methods: {
102106
}

0 commit comments

Comments
 (0)