mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
33 lines
570 B
Vue
33 lines
570 B
Vue
<template>
|
|
<van-cell :title="title" class="van-switch-cell">
|
|
<van-switch :value="value" @input="$emit('input', $event)" :disabled="disabled" :loading="loading" />
|
|
</van-cell>
|
|
</template>
|
|
|
|
<script>
|
|
import Cell from '../cell';
|
|
import Switch from '../switch';
|
|
|
|
export default {
|
|
name: 'van-switch-cell',
|
|
|
|
components: {
|
|
[Cell.name]: Cell,
|
|
[Switch.name]: Switch
|
|
},
|
|
|
|
props: {
|
|
title: String,
|
|
value: Boolean,
|
|
loading: Boolean,
|
|
disabled: Boolean
|
|
},
|
|
|
|
watch: {
|
|
value() {
|
|
this.$emit('change', this.value);
|
|
}
|
|
}
|
|
};
|
|
</script>
|