mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 09:24:25 +00:00
add CellSwitch component
This commit is contained in:
32
packages/switch-cell/index.vue
Normal file
32
packages/switch-cell/index.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<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>
|
Reference in New Issue
Block a user