iview/examples/routers/switch.vue

53 lines
1.5 KiB
Vue
Raw Normal View History

<template>
2017-03-02 11:19:00 +08:00
<div>
2018-06-22 10:14:13 +08:00
<i-switch v-model="m1" :loading="loading">
2017-03-02 11:19:00 +08:00
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
{{ m1 }}
2018-06-22 10:14:13 +08:00
<div @click="m1 = !m1">toggle</div>
<div @click="loading = !loading">loading</div>
2018-06-21 19:51:38 +08:00
<br><br>
2018-06-22 10:14:13 +08:00
<i-switch size="large" loading></i-switch>
2018-06-21 19:51:38 +08:00
<i-switch></i-switch>
2018-06-22 10:14:13 +08:00
<i-switch size="small" v-model="m1" :loading="loading"></i-switch>
2018-06-21 19:51:38 +08:00
<br><br>
<i-switch>
<span slot="open"></span>
<span slot="close"></span>
</i-switch>
<i-switch>
2018-07-03 10:03:13 +08:00
<Icon type="md-checkmark" slot="open"></Icon>
<Icon type="md-close" slot="close"></Icon>
2018-06-21 19:51:38 +08:00
</i-switch>
<br><br>
<i-switch size="large">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
2018-06-22 10:14:13 +08:00
<i-switch size="large" v-model="m1" :loading="loading">
2018-06-21 19:51:38 +08:00
<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-22 10:14:13 +08:00
m1: true,
disabled: true,
loading: false
}
},
methods: {
change (status) {
2017-03-02 11:19:00 +08:00
console.log(status)
}
}
}
</script>