props.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js';
  3. export default defineProps('areaPicker', {
  4. // 输入的值
  5. // #ifdef VUE2
  6. value: {
  7. type: [Array, String, Number],
  8. default: ''
  9. },
  10. // #endif
  11. // #ifdef VUE3
  12. modelValue: {
  13. type: [Array, String, Number],
  14. default: ''
  15. },
  16. // #endif
  17. // 是否展示picker弹窗
  18. show: {
  19. type: Boolean,
  20. default: false
  21. },
  22. // 是否显示省份
  23. province: {
  24. type: Boolean,
  25. default: true
  26. },
  27. // 是否显示城市
  28. city: {
  29. type: Boolean,
  30. default: true
  31. },
  32. // 是否显示区县
  33. county: {
  34. type: Boolean,
  35. default: true
  36. },
  37. // 是否展示顶部的操作栏
  38. showToolbar: {
  39. type: Boolean,
  40. default: true
  41. },
  42. // 顶部标题
  43. title: {
  44. type: String,
  45. default: ''
  46. },
  47. // 是否显示加载中状态
  48. loading: {
  49. type: Boolean,
  50. default: false
  51. },
  52. // 各列中,单个选项的高度
  53. itemHeight: {
  54. type: [String, Number],
  55. default: 44
  56. },
  57. // 取消按钮的文字
  58. cancelText: {
  59. type: String,
  60. default: () => uni.$u.$t('uAreaPicker.cancelText')
  61. },
  62. // 确认按钮的文字
  63. confirmText: {
  64. type: String,
  65. default: () => uni.$u.$t('uAreaPicker.confirmText')
  66. },
  67. // 取消按钮的颜色
  68. cancelColor: {
  69. type: String,
  70. default: theme.lightColor
  71. },
  72. // 确认按钮的颜色
  73. confirmColor: {
  74. type: String,
  75. default: theme.primary
  76. },
  77. // 每列中可见选项的数量
  78. visibleItemCount: {
  79. type: [String, Number],
  80. default: 5
  81. },
  82. // 是否允许点击遮罩关闭选择器
  83. closeOnClickOverlay: {
  84. type: Boolean,
  85. default: true
  86. },
  87. // 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效
  88. immediateChange: {
  89. type: Boolean,
  90. default: false
  91. },
  92. // 设置圆角值
  93. round: {
  94. type: String,
  95. default: ''
  96. },
  97. showInput: {
  98. type: Boolean,
  99. default: false
  100. },
  101. inputProps:{
  102. type: Object,
  103. default: () => ({
  104. placeholder: '请选择地区',
  105. separator: '/',
  106. clearable: true,
  107. disabled: true,
  108. backgroundColor: 'transparent',
  109. disabledColor: '#f5f7fa',
  110. placeholderClass: 'input-placeholder',
  111. placeholderStyle: 'color: #c0c4cc',
  112. confirmType: 'done',
  113. focus: false,
  114. inputAlign: 'left',
  115. fontSize: '15px',
  116. color: theme.contentColor,
  117. prefixIcon: '',
  118. prefixIconStyle: '',
  119. suffixIcon: '',
  120. suffixIconStyle: '',
  121. border: 'surround',
  122. shape: 'square',
  123. round: '4px',
  124. borderColor: '',
  125. })
  126. }
  127. })