We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents db6bfc3 + ac2bd2e commit 788686bCopy full SHA for 788686b
src/views/component/switch.js
@@ -1,6 +1,6 @@
1
export const switch_base = `
2
<label class="cd-switch checked">
3
- <input type="checkbox" data-toggle="cd-switch" value="1" checked/>
+ <input id="switch" type="checkbox" data-toggle="cd-switch" value="1" checked/>
4
</label>
5
`;
6
src/views/component/switch.vue
@@ -96,7 +96,11 @@ export default {
96
}
97
},
98
mounted() {
99
-
+ cd.onoff({
100
+ el: '#switch'
101
+ }).on('change', (value) => {
102
+ console.log('switch', value);
103
+ })
104
105
methods: {
106
0 commit comments