@tplc/wot
Version:
105 lines (104 loc) • 2.21 kB
TypeScript
import type { ComponentPublicInstance, ExtractPropTypes } from 'vue'
import type { PropType } from 'vue'
export type FabType = 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default'
export type FabPosition =
| 'left-top'
| 'right-top'
| 'left-bottom'
| 'right-bottom'
| 'left-center'
| 'right-center'
| 'top-center'
| 'bottom-center'
export type FabDirection = 'top' | 'right' | 'bottom' | 'left'
export type FabGap = Partial<Record<FabDirection, number>>
export declare const fabProps: {
/**
* 是否激活
*/
active: {
type: BooleanConstructor
default: boolean
}
/**
* 类型,可选值为 default primary info success warning error
*/
type: {
type: PropType<FabType>
default: FabType
}
/**
* 悬浮按钮位置,可选值为 left-top right-top left-bottom right-bottom left-center right-center top-center bottom-center
*/
position: {
type: PropType<FabPosition>
default: FabPosition
}
/**
* 悬浮按钮菜单弹出方向,可选值为 top bottom left right
*/
direction: {
type: PropType<FabDirection>
default: FabDirection
}
/**
* 是否禁用
*/
disabled: {
type: BooleanConstructor
default: boolean
}
/**
* 悬浮按钮未展开时的图标
*/
inactiveIcon: {
type: PropType<string>
default: string
}
/**
* 悬浮按钮展开时的图标
*/
activeIcon: {
type: PropType<string>
default: string
}
/**
* 自定义悬浮按钮层级
*/
zIndex: {
type: NumberConstructor
default: number
}
/**
* 是否可拖动
*/
draggable: {
type: BooleanConstructor
default: boolean
}
gap: {
type: PropType<FabGap>
default: () => {}
}
/**
* 用于控制点击时是否展开菜单
*/
expandable: {
type: BooleanConstructor
default: boolean
}
customStyle: {
type: PropType<string>
default: string
}
customClass: {
type: PropType<string>
default: string
}
}
export type FabProps = ExtractPropTypes<typeof fabProps>
export type FabExpose = {
open: () => void
close: () => void
}
export type FabInstance = ComponentPublicInstance<FabProps, FabExpose>