import type { ExtractPropTypes, PropType } from 'vue'; import type { SwipeActionOption } from '../../types/global'; /** * swipeAction 左滑单元格 props 类型定义 * @description 该组件一般用于左滑唤出操作菜单的场景,用的最多的是左滑删除操作。 */ export const SwipeActionProps = { /** 自定义根节点样式 */ customStyle: { type: [String, Object] as PropType>, default: () => ({}) }, /** 自定义根节点样式类 */ customClass: { type: String as unknown as PropType, default: '' }, /** index值,用于得知点击删除的是哪个按钮 */ index: { type: [Number, String] as PropType, default: '' }, /** 滑动按钮的宽度,单位为rpx */ btnWidth: { type: [String, Number] as PropType, default: 180 }, /** 是否禁止某个action滑动 */ disabled: { type: Boolean, default: false }, /** 打开或者关闭组件 */ show: { type: Boolean, default: false }, /** 组件背景颜色 */ bgColor: { type: String, default: 'var(--u-bg-white)' }, /** 是否使手机发生短促震动,目前只在iOS的微信小程序有效(2020-05-06) */ vibrateShort: { type: Boolean, default: false }, /** 按钮操作参数 */ options: { type: Array as PropType, default: () => [] } }; /** * swipeAction 组件 props 类型 */ export type SwipeActionProps = ExtractPropTypes;