import { use } from '../utils'; import Cell from '../cell'; import CellGroup from '../cell-group'; import { inherit } from '../utils/functional'; // Types import { CreateElement, RenderContext } from 'vue/types'; import { ScopedSlot, DefaultSlots } from '../utils/use/sfc'; export type PanelProps = { icon?: string; desc?: string; title?: string; status?: string; }; export type PanelSlots = DefaultSlots & { header?: ScopedSlot; footer?: ScopedSlot; }; const [sfc, bem] = use('panel'); function Panel( h: CreateElement, props: PanelProps, slots: PanelSlots, ctx: RenderContext ) { const Content = () => [ slots.header ? ( slots.header() ) : ( ),
{slots.default && slots.default()}
, slots.footer && (
{slots.footer()}
) ]; return ( ); } Panel.props = { icon: String, desc: String, title: String, status: String }; export default sfc(Panel);