mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
38 lines
842 B
JavaScript
38 lines
842 B
JavaScript
import { use } from '../utils';
|
|
import Cell from '../cell';
|
|
import CellGroup from '../cell-group';
|
|
|
|
const [sfc, bem] = use('panel');
|
|
|
|
function Panel(h, props, slots, ctx) {
|
|
return (
|
|
<CellGroup class={bem()} {...ctx.data}>
|
|
{slots.header ? (
|
|
slots.header()
|
|
) : (
|
|
<Cell
|
|
icon={props.icon}
|
|
label={props.desc}
|
|
title={props.title}
|
|
value={props.status}
|
|
class={bem('header')}
|
|
valueClass={bem('header-value')}
|
|
/>
|
|
)}
|
|
<div class={bem('content')}>{slots.default && slots.default()}</div>
|
|
{slots.footer && (
|
|
<div class={[bem('footer'), 'van-hairline--top']}>{slots.footer()}</div>
|
|
)}
|
|
</CellGroup>
|
|
);
|
|
}
|
|
|
|
Panel.props = {
|
|
icon: String,
|
|
desc: String,
|
|
title: String,
|
|
status: String
|
|
};
|
|
|
|
export default sfc(Panel);
|