You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
1.5 KiB

  1. import { defineMixin } from '../../libs/vue'
  2. import StickyDefaultProps from './sticky'
  3. import { registerComponentProps } from '../../libs/config/props.js'
  4. const defProps = registerComponentProps(StickyDefaultProps)
  5. export const props = defineMixin({
  6. props: {
  7. // 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
  8. offsetTop: {
  9. type: [String, Number],
  10. default: () => defProps.sticky.offsetTop
  11. },
  12. // 自定义导航栏的高度
  13. customNavHeight: {
  14. type: [String, Number],
  15. // #ifdef H5
  16. // H5端的导航栏属于“自定义”导航栏的范畴,因为它是非原生的,与普通元素一致
  17. default: 44,
  18. // #endif
  19. // #ifndef H5
  20. default: () => defProps.sticky.customNavHeight
  21. // #endif
  22. },
  23. // 是否开启吸顶功能
  24. disabled: {
  25. type: Boolean,
  26. default: () => defProps.sticky.disabled
  27. },
  28. // 吸顶区域的背景颜色
  29. bgColor: {
  30. type: String,
  31. default: () => defProps.sticky.bgColor
  32. },
  33. // z-index值
  34. zIndex: {
  35. type: [String, Number],
  36. default: () => defProps.sticky.zIndex
  37. },
  38. // 列表中的索引值
  39. index: {
  40. type: [String, Number],
  41. default: () => defProps.sticky.index
  42. }
  43. }
  44. })