From 82b29267a2b178be7419ad603250d11fa5900f0d Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 17 Feb 2019 18:23:48 +0800 Subject: [PATCH] [improvement] CellGroup: jsx (#2769) --- packages/cell-group/{index.js => index.tsx} | 16 ++++++++++++++-- packages/loading/index.tsx | 12 ++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) rename packages/cell-group/{index.js => index.tsx} (64%) diff --git a/packages/cell-group/index.js b/packages/cell-group/index.tsx similarity index 64% rename from packages/cell-group/index.js rename to packages/cell-group/index.tsx index 1b0203c4f..7ecd8acbb 100644 --- a/packages/cell-group/index.js +++ b/packages/cell-group/index.tsx @@ -1,9 +1,17 @@ import { use } from '../utils'; import { inherit } from '../utils/functional'; +// Types +import { FunctionalComponent } from '../utils/use/sfc'; + const [sfc, bem] = use('cell-group'); -function CellGroup(h, props, slots, ctx) { +const CellGroup: FunctionalComponent = function ( + h, + props, + slots, + ctx +) { return (
); -} +}; + +export type CellGroupProps = { + border?: boolean +}; CellGroup.props = { border: { diff --git a/packages/loading/index.tsx b/packages/loading/index.tsx index 7440a5690..fbd64155e 100644 --- a/packages/loading/index.tsx +++ b/packages/loading/index.tsx @@ -46,6 +46,12 @@ const Loading: FunctionalComponent = function( ); }; +export type LoadingProps = { + size?: string; + type?: string; + color?: string; +}; + Loading.props = { size: String, type: { @@ -58,10 +64,4 @@ Loading.props = { } }; -export type LoadingProps = { - size?: string; - type?: string; - color?: string; -}; - export default sfc(Loading);