mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(CellGroup): use tsx (#7989)
This commit is contained in:
parent
5d8fb9c523
commit
fa96d110ad
@ -15,27 +15,29 @@ export default createComponent({
|
||||
},
|
||||
|
||||
setup(props, { slots, attrs }) {
|
||||
const renderGroup = () => (
|
||||
<div class={[bem(), { [BORDER_TOP_BOTTOM]: props.border }]} {...attrs}>
|
||||
{slots.default?.()}
|
||||
</div>
|
||||
);
|
||||
|
||||
const renderTitle = () => (
|
||||
<div class={bem('title')}>
|
||||
{slots.title ? slots.title() : props.title}
|
||||
</div>
|
||||
);
|
||||
|
||||
return () => {
|
||||
const { title, border } = props;
|
||||
|
||||
const Group = (
|
||||
<div class={[bem(), { [BORDER_TOP_BOTTOM]: border }]} {...attrs}>
|
||||
{slots.default?.()}
|
||||
</div>
|
||||
);
|
||||
|
||||
if (title || slots.title) {
|
||||
if (props.title || slots.title) {
|
||||
return (
|
||||
<>
|
||||
<div class={bem('title')}>
|
||||
{slots.title ? slots.title() : title}
|
||||
</div>
|
||||
{Group}
|
||||
{renderTitle()}
|
||||
{renderGroup()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return Group;
|
||||
return renderGroup();
|
||||
};
|
||||
},
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user