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.

42 lines
1.3 KiB

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