mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 10:20:19 +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 }) {
|
setup(props, { slots, attrs }) {
|
||||||
return () => {
|
const renderGroup = () => (
|
||||||
const { title, border } = props;
|
<div class={[bem(), { [BORDER_TOP_BOTTOM]: props.border }]} {...attrs}>
|
||||||
|
|
||||||
const Group = (
|
|
||||||
<div class={[bem(), { [BORDER_TOP_BOTTOM]: border }]} {...attrs}>
|
|
||||||
{slots.default?.()}
|
{slots.default?.()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (title || slots.title) {
|
const renderTitle = () => (
|
||||||
|
<div class={bem('title')}>
|
||||||
|
{slots.title ? slots.title() : props.title}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (props.title || slots.title) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div class={bem('title')}>
|
{renderTitle()}
|
||||||
{slots.title ? slots.title() : title}
|
{renderGroup()}
|
||||||
</div>
|
|
||||||
{Group}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Group;
|
return renderGroup();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user