props.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js';
  3. export default defineProps('cascader', {
  4. // 是否显示级联选择器
  5. show: {
  6. type: Boolean,
  7. default: false
  8. },
  9. // 选择器标题
  10. title: {
  11. type: String,
  12. default: () => uni.$u.$t('uCascader.title')
  13. },
  14. // 标题样式
  15. titleStyle: {
  16. type: [Object, String],
  17. default: () => ({})
  18. },
  19. // 选项数据
  20. options: {
  21. type: Array,
  22. default: () => []
  23. },
  24. // #ifdef VUE3
  25. // 当前选中值
  26. modelValue: {
  27. type: [String, Number, Array],
  28. default: ''
  29. },
  30. // #endif
  31. // v-model 的别名
  32. value: {
  33. type: [String, Number, Array],
  34. default: ''
  35. },
  36. // 占位符文本
  37. placeholder: {
  38. type: String,
  39. default: () => uni.$u.$t('uCascader.placeholder')
  40. },
  41. // 自定义字段名
  42. field: {
  43. type: Object,
  44. default: () => ({
  45. text: 'label',
  46. value: 'value',
  47. children: 'children'
  48. })
  49. },
  50. // 是否显示关闭按钮
  51. closeable: {
  52. type: Boolean,
  53. default: true
  54. },
  55. // 是否点击遮罩关闭
  56. closeOnClickOverlay: {
  57. type: Boolean,
  58. default: true
  59. },
  60. // 背景色
  61. bgColor: {
  62. type: String,
  63. default: '#fff'
  64. },
  65. // 主题色
  66. activeColor: {
  67. type: String,
  68. default: theme.primary
  69. },
  70. // 选中背景色
  71. activeBgColor: {
  72. type: String,
  73. default: ''
  74. },
  75. // 选中文本加粗
  76. activeBold: {
  77. type: Boolean,
  78. default: false
  79. },
  80. // 图标颜色
  81. iconColor: {
  82. type: String,
  83. default: ''
  84. },
  85. // 文本色
  86. color: {
  87. type: String,
  88. default: theme.mainColor
  89. },
  90. // 字体大小
  91. fontSize: {
  92. type: String,
  93. default: '15px'
  94. },
  95. // 标题字体大小
  96. titleFontSize: {
  97. type: String,
  98. default: '18px'
  99. },
  100. // 标题颜色
  101. titleColor: {
  102. type: String,
  103. default: theme.mainColor
  104. },
  105. // 圆角
  106. round: {
  107. type: [String, Number],
  108. default: 0
  109. },
  110. // 层级
  111. zIndex: {
  112. type: [String, Number],
  113. default: 10075
  114. },
  115. // 是否安全区域
  116. safeAreaInsetBottom: {
  117. type: Boolean,
  118. default: true
  119. },
  120. // 选项高度
  121. itemHeight: {
  122. type: String,
  123. default: '40px'
  124. }
  125. })