diff --git a/packages/cell/index.tsx b/packages/cell/index.tsx index 2b43d2ce5..40c1ffaf0 100644 --- a/packages/cell/index.tsx +++ b/packages/cell/index.tsx @@ -23,7 +23,7 @@ export type CellSlots = DefaultSlots & { }; export type CellEvents = { - onClick(event: Event): void; + onClick?(event: Event): void; }; const [sfc, bem] = use('cell'); diff --git a/packages/panel/index.js b/packages/panel/index.tsx similarity index 64% rename from packages/panel/index.js rename to packages/panel/index.tsx index 70cb93829..952a6168b 100644 --- a/packages/panel/index.js +++ b/packages/panel/index.tsx @@ -3,9 +3,30 @@ 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, props, slots, ctx) { +function Panel( + h: CreateElement, + props: PanelProps, + slots: PanelSlots, + ctx: RenderContext +) { const Content = () => [ slots.header ? ( slots.header() @@ -41,4 +62,4 @@ Panel.props = { status: String }; -export default sfc(Panel); +export default sfc(Panel);