props.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 控制是否出现滚动条,仅nvue有效
  6. showScrollbar: {
  7. type: Boolean,
  8. default: () => defProps.list.showScrollbar
  9. },
  10. // 距底部多少时触发scrolltolower事件
  11. lowerThreshold: {
  12. type: [String, Number],
  13. default: () => defProps.list.lowerThreshold
  14. },
  15. // 距顶部多少时触发scrolltoupper事件,非nvue有效
  16. upperThreshold: {
  17. type: [String, Number],
  18. default: () => defProps.list.upperThreshold
  19. },
  20. // 设置竖向滚动条位置
  21. scrollTop: {
  22. type: [String, Number],
  23. default: () => defProps.list.scrollTop
  24. },
  25. // 控制 onscroll 事件触发的频率,仅nvue有效
  26. offsetAccuracy: {
  27. type: [String, Number],
  28. default: () => defProps.list.offsetAccuracy
  29. },
  30. // 启用 flexbox 布局。开启后,当前节点声明了display: flex就会成为flex container,并作用于其孩子节点,仅微信小程序有效
  31. enableFlex: {
  32. type: Boolean,
  33. default: () => defProps.list.enableFlex
  34. },
  35. // 是否按分页模式显示List,默认值false
  36. pagingEnabled: {
  37. type: Boolean,
  38. default: () => defProps.list.pagingEnabled
  39. },
  40. // 是否允许List滚动
  41. scrollable: {
  42. type: Boolean,
  43. default: () => defProps.list.scrollable
  44. },
  45. // 值应为某子元素id(id不能以数字开头)
  46. scrollIntoView: {
  47. type: String,
  48. default: () => defProps.list.scrollIntoView
  49. },
  50. // 在设置滚动条位置时使用动画过渡
  51. scrollWithAnimation: {
  52. type: Boolean,
  53. default: () => defProps.list.scrollWithAnimation
  54. },
  55. // iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只对微信小程序有效
  56. enableBackToTop: {
  57. type: Boolean,
  58. default: () => defProps.list.enableBackToTop
  59. },
  60. // 列表的高度
  61. height: {
  62. type: [String, Number],
  63. default: () => defProps.list.height
  64. },
  65. // 列表宽度
  66. width: {
  67. type: [String, Number],
  68. default: () => defProps.list.width
  69. },
  70. // 列表前后预渲染的屏数,1代表一个屏幕的高度,1.5代表1个半屏幕高度
  71. preLoadScreen: {
  72. type: [String, Number],
  73. default: () => defProps.list.preLoadScreen
  74. },
  75. // 开启自定义下拉刷新
  76. refresherEnabled: {
  77. type: Boolean,
  78. default: () => false
  79. },
  80. // 设置自定义下拉刷新阈值
  81. refresherThreshold: {
  82. type: Number,
  83. default: () => 45
  84. },
  85. // 设置自定义下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式
  86. refresherDefaultStyle: {
  87. type: String,
  88. default: () => 'black'
  89. },
  90. // 设置自定义下拉刷新区域背景颜色
  91. refresherBackground: {
  92. type: String,
  93. default: () => '#FFF'
  94. },
  95. // 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
  96. refresherTriggered: {
  97. type: Boolean,
  98. default: () => false
  99. }
  100. }
  101. })