iview/examples/routers/switch.vue

51 lines
1.4 KiB
Vue
Raw Normal View History

<template>
2017-03-02 11:19:00 +08:00
<div>
2017-09-07 11:19:19 +08:00
<i-switch v-model="m1" true-value="yes" false-value="no">
2017-03-02 11:19:00 +08:00
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
{{ m1 }}
2017-09-07 11:19:19 +08:00
<div @click="m1 = 'no'">toggle</div>
2018-06-21 19:51:38 +08:00
<br><br>
<i-switch size="large"></i-switch>
<i-switch></i-switch>
<i-switch size="small"></i-switch>
<br><br>
<i-switch>
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
<i-switch>
<Icon type="android-done" slot="open"></Icon>
<Icon type="android-close" slot="close"></Icon>
</i-switch>
<br><br>
<i-switch size="large">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
<i-switch size="large">
<span slot="open">ON</span>
<span slot="close">OFF</span>
</i-switch>
<br><br>
<i-switch :disabled="disabled"></i-switch>
<Button type="primary" @click="disabled = !disabled">Toggle Disabled</Button>
2017-03-02 11:19:00 +08:00
</div>
</template>
<script>
export default {
data () {
return {
2018-06-21 19:51:38 +08:00
m1: 'yes',
disabled: true
}
},
methods: {
change (status) {
2017-03-02 11:19:00 +08:00
console.log(status)
}
}
}
</script>