Files
cmgd-mini-app/uni_modules/nutui-uni/components/sticky/sticky.ts
2026-01-05 12:47:14 +08:00

33 lines
859 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { ExtractPropTypes } from 'vue'
import { commonProps, isH5, makeNumericProp, makeStringProp } from '../_utils'
export const stickyProps = {
...commonProps,
/**
* @description 吸顶距离
*/
offsetTop: makeNumericProp(0),
/**
* @description 吸附时的层级
*/
zIndex: {
type: [Number, String],
default: 2000,
},
/**
* @description 导航栏高度,自定义导航栏时,需要传入此值
* - H5端的导航栏属于“自定义”导航栏的范畴因为它是非原生的与普通元素一致
*/
customNavHeight: makeNumericProp(isH5 ? 44 : 0),
/**
* @description 是否开启吸顶功能
*/
disabled: Boolean,
/**
* @description 吸顶区域的背景颜色
*/
bgColor: makeStringProp('transparent'),
}
export type StickyProps = ExtractPropTypes<typeof stickyProps>