mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
55 lines
815 B
Vue
55 lines
815 B
Vue
<template>
|
|
<cell
|
|
center
|
|
:title="title"
|
|
:border="border"
|
|
:class="b()"
|
|
>
|
|
<van-switch
|
|
v-bind="$props"
|
|
@input="$emit('input', $event)"
|
|
/>
|
|
</cell>
|
|
</template>
|
|
|
|
<script>
|
|
import VanSwitch from '../switch';
|
|
import create from '../utils/create';
|
|
|
|
export default create({
|
|
name: 'switch-cell',
|
|
|
|
components: {
|
|
VanSwitch
|
|
},
|
|
|
|
props: {
|
|
value: null,
|
|
title: String,
|
|
border: Boolean,
|
|
loading: Boolean,
|
|
disabled: Boolean,
|
|
activeColor: String,
|
|
inactiveColor: String,
|
|
activeValue: {
|
|
type: null,
|
|
default: true
|
|
},
|
|
inactiveValue: {
|
|
type: null,
|
|
default: false
|
|
},
|
|
size: {
|
|
type: String,
|
|
default: '24px'
|
|
}
|
|
},
|
|
|
|
watch: {
|
|
value() {
|
|
this.$emit('change', this.value);
|
|
}
|
|
}
|
|
});
|
|
</script>
|