[new feature] Button: add loading-size prop (#2854)

This commit is contained in:
neverland
2019-02-26 19:35:59 +08:00
committed by GitHub
parent c3cf74cda0
commit 5cb0edbf39
5 changed files with 27 additions and 1 deletions
+6 -1
View File
@@ -19,6 +19,7 @@ export type ButtonProps = RouteProps & {
loading?: boolean;
disabled?: boolean;
nativeType?: string;
loadingSize: string;
loadingText?: string;
bottomAction?: boolean;
};
@@ -66,7 +67,7 @@ function Button(
>
{loading ? (
[
<Loading size="20px" color={type === 'default' ? undefined : ''} />,
<Loading size={props.loadingSize} color={type === 'default' ? undefined : ''} />,
loadingText && <span class={bem('loading-text')}>{loadingText}</span>
]
) : (
@@ -101,6 +102,10 @@ Button.props = {
size: {
type: String,
default: 'normal'
},
loadingSize: {
type: String,
default: '20px'
}
};