dm-vue3-ui
Version:
This Components Library will help get you started developing in Vue 3.
110 lines (109 loc) • 3.34 kB
TypeScript
import type { VNode, Slot } from 'vue';
type ButtonType = 'default' | 'reverse' | 'primary' | 'danger' | 'dashed' | 'text' | 'link';
type ButtonShape = 'default' | 'circle' | 'round';
type ButtonSize = 'small' | 'middle' | 'large';
type LoadingType = 'static' | 'dynamic';
type TargetType = '_self' | '_blank';
interface Props {
/** 设置按钮类型 */
type?: ButtonType;
/** 设置按钮形状 */
shape?: ButtonShape;
/** 设置按钮图标 */
icon?: VNode | Slot;
/** 设置按钮尺寸 */
size?: ButtonSize;
/** 按钮背景是否透明,仅当 type: 'primary' | 'danger' 时生效 */
ghost?: boolean;
/** 设置按钮类名 */
customClass?: string;
/** 点击跳转的地址,与 a 链接的 href 属性一致 */
href?: string;
/** 如何打开目标链接,相当于 a 链接的 target 属性,href 存在时生效 */
target?: TargetType;
/** 是否支持键盘操作 */
keyboard?: boolean;
/** 是否禁用 */
disabled?: boolean;
/** 是否加载中 */
loading?: boolean;
/** 加载指示符类型 */
loadingType?: LoadingType;
/** 是否将按钮宽度调整为其父宽度 */
block?: boolean;
}
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
type: string;
shape: string;
icon: undefined;
size: string;
ghost: boolean;
customClass: undefined;
href: undefined;
target: string;
keyboard: boolean;
disabled: boolean;
loading: boolean;
loadingType: string;
block: boolean;
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
click: (event: Event) => void;
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
type: string;
shape: string;
icon: undefined;
size: string;
ghost: boolean;
customClass: undefined;
href: undefined;
target: string;
keyboard: boolean;
disabled: boolean;
loading: boolean;
loadingType: string;
block: boolean;
}>>> & {
onClick?: ((event: Event) => any) | undefined;
}, {
size: ButtonSize;
type: ButtonType;
shape: ButtonShape;
icon: VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | Slot;
ghost: boolean;
customClass: string;
href: string;
target: TargetType;
keyboard: boolean;
disabled: boolean;
loading: boolean;
loadingType: LoadingType;
block: boolean;
}, {}>, {
icon?(_: {}): any;
default?(_: {}): any;
}>;
export default _default;
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
type __VLS_TypePropsToRuntimeProps<T> = {
[K in keyof T]-?: {} extends Pick<T, K> ? {
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
} : {
type: import('vue').PropType<T[K]>;
required: true;
};
};
type __VLS_WithDefaults<P, D> = {
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
default: D[K];
}> : P[K];
};
type __VLS_Prettify<T> = {
[K in keyof T]: T[K];
} & {};
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};