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