props.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. export default {
  2. props: {
  3. // 显示的内容,数组
  4. text: {
  5. type: [Array, String],
  6. default: () => []
  7. },
  8. // 通告滚动模式,row-横向滚动,column-竖向滚动
  9. direction: {
  10. type: String,
  11. default: 'row'
  12. },
  13. // direction = row时,是否使用步进形式滚动
  14. step: {
  15. type: Boolean,
  16. default: false
  17. },
  18. // 是否显示左侧的音量图标
  19. icon: {
  20. type: [String, Boolean, null],
  21. default: 'volume'
  22. },
  23. // 通告模式,link-显示右箭头,closable-显示右侧关闭图标
  24. mode: {
  25. type: String,
  26. default: ''
  27. },
  28. // 文字颜色,各图标也会使用文字颜色
  29. color: {
  30. type: String,
  31. default: '#f9ae3d'
  32. },
  33. // 背景颜色
  34. bgColor: {
  35. type: String,
  36. default: '#fdf6ec'
  37. },
  38. // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度
  39. speed: {
  40. type: [String, Number],
  41. default: 80
  42. },
  43. // 字体大小
  44. fontSize: {
  45. type: [String, Number],
  46. default: 14
  47. },
  48. // 滚动一个周期的时间长,单位ms
  49. duration: {
  50. type: [String, Number],
  51. default: 2000
  52. },
  53. // 跳转的页面路径
  54. url: {
  55. type: String,
  56. default: ''
  57. },
  58. // 页面跳转的类型
  59. linkType: {
  60. type: String,
  61. default: 'navigateTo'
  62. },
  63. // 是否禁止用手滑动切换
  64. // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序
  65. disableTouch: {
  66. type: Boolean,
  67. default: true
  68. },
  69. // 是否禁止滚动,仅`direction="column"生效`
  70. disableScroll: {
  71. type: Boolean,
  72. default: false
  73. },
  74. ...uni.$uv?.props?.noticeBar
  75. }
  76. }