props.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import defprops from '../../libs/config/props';
  2. export default {
  3. props: {
  4. // 搜索框形状,round-圆形,square-方形
  5. shape: {
  6. type: String,
  7. default: defprops.search.shape
  8. },
  9. // 搜索框背景色,默认值#f2f2f2
  10. bgColor: {
  11. type: String,
  12. default: defprops.search.bgColor
  13. },
  14. // 占位提示文字
  15. placeholder: {
  16. type: String,
  17. default: defprops.search.placeholder
  18. },
  19. // 是否启用清除控件
  20. clearabled: {
  21. type: Boolean,
  22. default: defprops.search.clearabled
  23. },
  24. // 是否自动聚焦
  25. focus: {
  26. type: Boolean,
  27. default: defprops.search.focus
  28. },
  29. // 是否在搜索框右侧显示取消按钮
  30. showAction: {
  31. type: Boolean,
  32. default: defprops.search.showAction
  33. },
  34. // 右边控件的样式
  35. actionStyle: {
  36. type: Object,
  37. default: defprops.search.actionStyle
  38. },
  39. // 取消按钮文字
  40. actionText: {
  41. type: String,
  42. default: defprops.search.actionText
  43. },
  44. // 输入框内容对齐方式,可选值为 left|center|right
  45. inputAlign: {
  46. type: String,
  47. default: defprops.search.inputAlign
  48. },
  49. // input输入框的样式,可以定义文字颜色,大小等,对象形式
  50. inputStyle: {
  51. type: Object,
  52. default: defprops.search.inputStyle
  53. },
  54. // 是否启用输入框
  55. disabled: {
  56. type: Boolean,
  57. default: defprops.search.disabled
  58. },
  59. // 边框颜色
  60. borderColor: {
  61. type: String,
  62. default: defprops.search.borderColor
  63. },
  64. // 搜索图标的颜色,默认同输入框字体颜色
  65. searchIconColor: {
  66. type: String,
  67. default: defprops.search.searchIconColor
  68. },
  69. // 输入框字体颜色
  70. color: {
  71. type: String,
  72. default: defprops.search.color
  73. },
  74. // placeholder的颜色
  75. placeholderColor: {
  76. type: String,
  77. default: defprops.search.placeholderColor
  78. },
  79. // 左边输入框的图标,可以为uView图标名称或图片路径
  80. searchIcon: {
  81. type: String,
  82. default: defprops.search.searchIcon
  83. },
  84. searchIconSize: {
  85. type: [Number, String],
  86. default: defprops.search.searchIconSize
  87. },
  88. // 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px"、"30px 20px"等写法
  89. margin: {
  90. type: String,
  91. default: defprops.search.margin
  92. },
  93. // 开启showAction时,是否在input获取焦点时才显示
  94. animation: {
  95. type: Boolean,
  96. default: defprops.search.animation
  97. },
  98. // 输入框的初始化内容
  99. modelValue: {
  100. type: String,
  101. default: defprops.search.value
  102. },
  103. value: {
  104. type: String,
  105. default: defprops.search.value
  106. },
  107. // 输入框最大能输入的长度,-1为不限制长度(来自uniapp文档)
  108. maxlength: {
  109. type: [String, Number],
  110. default: defprops.search.maxlength
  111. },
  112. // 搜索框高度,单位px
  113. height: {
  114. type: [String, Number],
  115. default: defprops.search.height
  116. },
  117. // 搜索框左侧文本
  118. label: {
  119. type: [String, Number, null],
  120. default: defprops.search.label
  121. }
  122. }
  123. }