nutui-uniapp
Version:
京东风格的轻量级移动端 Uniapp、Vue3 组件库(支持小程序开发)
64 lines (52 loc) • 1.37 kB
text/typescript
import type { ExtractPropTypes } from 'vue'
import { SELECTED_EVENT, UPDATE_VISIBLE_EVENT } from '../_constants'
import { commonProps, isBoolean, makeArrayProp, makeStringProp, truthProp } from '../_utils'
export const fixednavProps = {
...commonProps,
/**
* @description 是否打开
*/
visible: Boolean,
/**
* @description 悬浮列表内容数据
*/
navList: makeArrayProp<any>([]),
/**
* @description 选中按钮文案颜色
*/
activeColor: makeStringProp(''),
/**
* @description 收起列表按钮文案
*/
activeText: makeStringProp(''),
/**
* @description 展开列表按钮文案
*/
unActiveText: makeStringProp(''),
/**
* @description 导航方向,可选值 'left'、'right'
*/
type: makeStringProp<'left' | 'right'>('right'),
/**
* @description 展开时是否显示遮罩
*/
overlay: truthProp,
/**
* @description fixed 垂直位置
*/
position: {
default: () => {
return {
top: 'auto',
bottom: 'auto',
}
},
type: Object,
},
}
export type FixednavProps = ExtractPropTypes<typeof fixednavProps>
export const fixednavEmits = {
[UPDATE_VISIBLE_EVENT]: (val: boolean) => isBoolean(val),
[SELECTED_EVENT]: (val: { item: any, event: Event }) => val instanceof Object,
}
export type FixednavEmits = typeof fixednavEmits