init
This commit is contained in:
38
uni_modules/nutui-uni/components/swipe/swipe.ts
Normal file
38
uni_modules/nutui-uni/components/swipe/swipe.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { ExtractPropTypes } from 'vue'
|
||||
import { CLICK_EVENT } from '../_constants'
|
||||
import { commonProps, isString, makeArrayProp } from '../_utils'
|
||||
import type { SwipePosition, SwipeToggleEvent } from './types'
|
||||
|
||||
export const swipeProps = {
|
||||
...commonProps,
|
||||
/**
|
||||
* @description 唯一标识
|
||||
*/
|
||||
name: String,
|
||||
/**
|
||||
* @description 是否阻止滑动事件冒泡
|
||||
*/
|
||||
touchMoveStopPropagation: Boolean,
|
||||
/**
|
||||
* @description 是否阻止滑动事件行为
|
||||
*/
|
||||
touchMovePreventDefault: Boolean,
|
||||
/**
|
||||
* @description 是否禁用滑动
|
||||
*/
|
||||
disabled: Boolean,
|
||||
/**
|
||||
* @description 点击自动关闭的部分
|
||||
*/
|
||||
closeOnClick: makeArrayProp<SwipePosition>(['left', 'content', 'right']),
|
||||
}
|
||||
|
||||
export type SwipeProps = ExtractPropTypes<typeof swipeProps>
|
||||
|
||||
export const swipeEmits = {
|
||||
open: (event: SwipeToggleEvent) => event instanceof Object,
|
||||
close: (event: SwipeToggleEvent) => event instanceof Object,
|
||||
[CLICK_EVENT]: (val: string) => isString(val),
|
||||
}
|
||||
|
||||
export type SwipeEmits = typeof swipeEmits
|
||||
Reference in New Issue
Block a user