forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.ts
42 lines (36 loc) · 1.34 KB
/
interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
import { tourProps as VCTourProps, tourStepProps as VCTourStepProps } from '../vc-tour';
import type { VueNode } from '../_util/type';
export const tourProps = () => ({
...VCTourProps(),
steps: { type: Array as PropType<TourStepProps[]> },
prefixCls: { type: String },
current: { type: Number },
type: { type: String as PropType<'default' | 'primary'> }, // default 类型,影响底色与文字颜色
'onUpdate:current': Function as PropType<(val: number) => void>,
});
export type TourProps = Partial<ExtractPropTypes<ReturnType<typeof tourProps>>>;
export interface TourBtnProps {
children?: () => VueNode;
onClick?: () => void;
className?: string;
style?: CSSProperties;
}
export const tourStepProps = () => ({
...VCTourStepProps(),
cover: { type: Object as PropType<VueNode> }, // 展示的图片或者视频
nextButtonProps: {
type: Object as PropType<TourBtnProps>,
},
prevButtonProps: {
type: Object as PropType<TourBtnProps>,
},
current: { type: Number },
type: { type: String as PropType<'default' | 'primary'> }, // default 类型,影响底色与文字颜色
});
export type TourStepProps = Partial<ExtractPropTypes<ReturnType<typeof tourStepProps>>>;
export interface TourLocale {
Next: string;
Previous: string;
Finish: string;
}