综合办公系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

props.js 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. export default {
  2. props: {
  3. value: {
  4. type: [String, Number],
  5. default: ''
  6. },
  7. modelValue: {
  8. type: [String, Number],
  9. default: ''
  10. },
  11. // 输入框类型
  12. // number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
  13. // idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
  14. // digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
  15. // text-文本输入键盘
  16. type: {
  17. type: String,
  18. default: 'text'
  19. },
  20. // 是否禁用输入框
  21. disabled: {
  22. type: Boolean,
  23. default: false
  24. },
  25. // 禁用状态时的背景色
  26. disabledColor: {
  27. type: String,
  28. default: '#f5f7fa'
  29. },
  30. // 是否显示清除控件
  31. clearable: {
  32. type: Boolean,
  33. default: false
  34. },
  35. // 是否密码类型
  36. password: {
  37. type: Boolean,
  38. default: false
  39. },
  40. // 最大输入长度,设置为 -1 的时候不限制最大长度
  41. maxlength: {
  42. type: [String, Number],
  43. default: -1
  44. },
  45. // 输入框为空时的占位符
  46. placeholder: {
  47. type: String,
  48. default: null
  49. },
  50. // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
  51. placeholderClass: {
  52. type: String,
  53. default: 'input-placeholder'
  54. },
  55. // 指定placeholder的样式
  56. placeholderStyle: {
  57. type: [String, Object],
  58. default: 'color: #c0c4cc'
  59. },
  60. // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
  61. // https://uniapp.dcloud.io/component/input
  62. // https://uniapp.dcloud.io/component/textarea
  63. confirmType: {
  64. type: String,
  65. default: 'done'
  66. },
  67. // 点击键盘右下角按钮时是否保持键盘不收起,H5无效
  68. confirmHold: {
  69. type: Boolean,
  70. default: false
  71. },
  72. // focus时,点击页面的时候不收起键盘,微信小程序有效
  73. holdKeyboard: {
  74. type: Boolean,
  75. default: false
  76. },
  77. // 自动获取焦点
  78. // 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
  79. focus: {
  80. type: Boolean,
  81. default: false
  82. },
  83. // 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
  84. autoBlur: {
  85. type: Boolean,
  86. default: false
  87. },
  88. // 指定focus时光标的位置
  89. cursor: {
  90. type: [String, Number],
  91. default: -1
  92. },
  93. // 输入框聚焦时底部与键盘的距离
  94. cursorSpacing: {
  95. type: [String, Number],
  96. default: 30
  97. },
  98. // 光标起始位置,自动聚集时有效,需与selection-end搭配使用
  99. selectionStart: {
  100. type: [String, Number],
  101. default: -1
  102. },
  103. // 光标结束位置,自动聚集时有效,需与selection-start搭配使用
  104. selectionEnd: {
  105. type: [String, Number],
  106. default: -1
  107. },
  108. // 键盘弹起时,是否自动上推页面
  109. adjustPosition: {
  110. type: Boolean,
  111. default: true
  112. },
  113. // 输入框内容对齐方式,可选值为:left|center|right
  114. inputAlign: {
  115. type: String,
  116. default: 'left'
  117. },
  118. // 输入框字体的大小
  119. fontSize: {
  120. type: [String, Number],
  121. default: '14px'
  122. },
  123. // 输入框字体颜色
  124. color: {
  125. type: String,
  126. default: '#303133'
  127. },
  128. // 输入框前置图标
  129. prefixIcon: {
  130. type: String,
  131. default: ''
  132. },
  133. // 前置图标样式,对象或字符串
  134. prefixIconStyle: {
  135. type: [String, Object],
  136. default: ''
  137. },
  138. // 输入框后置图标
  139. suffixIcon: {
  140. type: String,
  141. default: ''
  142. },
  143. // 后置图标样式,对象或字符串
  144. suffixIconStyle: {
  145. type: [String, Object],
  146. default: ''
  147. },
  148. // 边框类型,surround-四周边框,bottom-底部边框,none-无边框
  149. border: {
  150. type: String,
  151. default: 'surround'
  152. },
  153. // 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
  154. readonly: {
  155. type: Boolean,
  156. default: false
  157. },
  158. // 输入框形状,circle-圆形,square-方形
  159. shape: {
  160. type: String,
  161. default: 'square'
  162. },
  163. // 用于处理或者过滤输入框内容的方法
  164. formatter: {
  165. type: [Function, null],
  166. default: null
  167. },
  168. // 是否忽略组件内对文本合成系统事件的处理
  169. ignoreCompositionEvent: {
  170. type: Boolean,
  171. default: true
  172. },
  173. ...uni.$uv?.props?.input
  174. }
  175. }