types(Stepper): improve theme prop typing (#8489)

This commit is contained in:
neverland 2021-04-09 14:41:48 +08:00 committed by GitHub
parent 07431487f3
commit 471fabb810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -30,11 +30,13 @@ function add(num1: number, num2: number) {
return Math.round((num1 + num2) * cardinal) / cardinal;
}
export type StepperTheme = 'default' | 'round';
export default defineComponent({
name,
props: {
theme: String,
theme: String as PropType<StepperTheme>,
integer: Boolean,
disabled: Boolean,
allowEmpty: Boolean,

View File

@ -1,7 +1,8 @@
import { withInstall } from '../utils';
import _Stepper from './Stepper';
import _Stepper, { StepperTheme } from './Stepper';
const Stepper = withInstall<typeof _Stepper>(_Stepper);
export default Stepper;
export { Stepper };
export type { StepperTheme };