From a34daeca3e0d60ebda1be5f17a32201c5bd99ca2 Mon Sep 17 00:00:00 2001 From: "huang.jian" Date: Wed, 27 May 2020 14:16:34 +0800 Subject: [PATCH] fix: add missing property --- packages/Icon/Icon.tsx | 2 +- packages/Loading/Loading.tsx | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/Icon/Icon.tsx b/packages/Icon/Icon.tsx index ceebaac..8bed754 100644 --- a/packages/Icon/Icon.tsx +++ b/packages/Icon/Icon.tsx @@ -11,7 +11,7 @@ interface IconProps { name: string; dot?: boolean; color?: string; - size: string; + size?: string; onClick?: (event: any) => void; // info#info message?: string; diff --git a/packages/Loading/Loading.tsx b/packages/Loading/Loading.tsx index 87ffd78..c0a94c4 100644 --- a/packages/Loading/Loading.tsx +++ b/packages/Loading/Loading.tsx @@ -1,5 +1,5 @@ // packages -import React, { FunctionComponent, Fragment } from 'react'; +import React, { FunctionComponent, Fragment, CSSProperties } from 'react'; import clsx from 'clsx'; import { View } from 'remax/wechat'; // internal @@ -9,6 +9,8 @@ import withDefaultProps from '../tools/with-default-props'; interface LoadingProps { vertical: boolean; type: 'spinner' | 'circular'; + color?: string; + size?: string; // 容器类名,用以覆盖内部 className?: string; // loading 提示信息 @@ -29,7 +31,7 @@ const Dots: FunctionComponent = () => ( ); const Loading: FunctionComponent = (props) => { - const { vertical, className, type, message } = props; + const { vertical, className, type, color, message, size } = props; const classnames = { container: clsx('van-loading', className, { 'van-loading--vertical': vertical, @@ -39,9 +41,16 @@ const Loading: FunctionComponent = (props) => { 'van-loading__spinner--circular': type === 'circular', }), }; + const stylesheets: Record<'container', CSSProperties> = { + container: { + color, + width: size, + height: size, + }, + }; return ( - + {type === 'spinner' && }