mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
32 lines
614 B
JavaScript
32 lines
614 B
JavaScript
import { use } from '../utils';
|
|
import Cell from '../cell';
|
|
import Switch from '../switch';
|
|
import SwitchMixin from '../mixins/switch';
|
|
|
|
const [sfc, bem] = use('switch-cell');
|
|
|
|
export default sfc({
|
|
functional: true,
|
|
|
|
mixins: [SwitchMixin],
|
|
|
|
props: {
|
|
title: String,
|
|
border: Boolean,
|
|
size: {
|
|
type: String,
|
|
default: '24px'
|
|
}
|
|
},
|
|
|
|
render(h, context, inherit) {
|
|
const { props } = context;
|
|
|
|
return (
|
|
<Cell center title={props.title} border={props.border} class={bem()} {...inherit}>
|
|
<Switch {...{ props, on: context.listeners }} />
|
|
</Cell>
|
|
);
|
|
}
|
|
});
|