裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.0 KiB

1 month ago
  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. placeholder: {
  13. type: [String, Number],
  14. default: ''
  15. },
  16. // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
  17. placeholderClass: {
  18. type: String,
  19. default: 'textarea-placeholder'
  20. },
  21. // 指定placeholder的样式
  22. placeholderStyle: {
  23. type: [String, Object],
  24. default: 'color: #c0c4cc'
  25. },
  26. // 输入框高度
  27. height: {
  28. type: [String, Number],
  29. default: 70
  30. },
  31. // 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
  32. confirmType: {
  33. type: String,
  34. default: 'return'
  35. },
  36. // 是否禁用
  37. disabled: {
  38. type: Boolean,
  39. default: false
  40. },
  41. // 是否显示统计字数
  42. count: {
  43. type: Boolean,
  44. default: false
  45. },
  46. // 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
  47. focus: {
  48. type: Boolean,
  49. default: false
  50. },
  51. // 是否自动增加高度
  52. autoHeight: {
  53. type: Boolean,
  54. default: false
  55. },
  56. // 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
  57. fixed: {
  58. type: Boolean,
  59. default: false
  60. },
  61. // 指定光标与键盘的距离
  62. cursorSpacing: {
  63. type: Number,
  64. default: 0
  65. },
  66. // 指定focus时的光标位置
  67. cursor: {
  68. type: [String, Number],
  69. default: ''
  70. },
  71. // 是否显示键盘上方带有”完成“按钮那一栏,
  72. showConfirmBar: {
  73. type: Boolean,
  74. default: true
  75. },
  76. // 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
  77. selectionStart: {
  78. type: Number,
  79. default: -1
  80. },
  81. // 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
  82. selectionEnd: {
  83. type: Number,
  84. default: -1
  85. },
  86. // 键盘弹起时,是否自动上推页面
  87. adjustPosition: {
  88. type: Boolean,
  89. default: true
  90. },
  91. // 是否去掉 iOS 下的默认内边距,只微信小程序有效
  92. disableDefaultPadding: {
  93. type: Boolean,
  94. default: false
  95. },
  96. // focus时,点击页面的时候不收起键盘,只微信小程序有效
  97. holdKeyboard: {
  98. type: Boolean,
  99. default: false
  100. },
  101. // 最大输入长度,设置为 -1 的时候不限制最大长度
  102. maxlength: {
  103. type: [String, Number],
  104. default: 140
  105. },
  106. // 边框类型,surround-四周边框,bottom-底部边框
  107. border: {
  108. type: String,
  109. default: 'surround'
  110. },
  111. // 用于处理或者过滤输入框内容的方法
  112. formatter: {
  113. type: [Function, null],
  114. default: null
  115. },
  116. // 是否忽略组件内对文本合成系统事件的处理
  117. ignoreCompositionEvent: {
  118. type: Boolean,
  119. default: true
  120. },
  121. // 是否忽略组件内对文本合成系统事件的处理
  122. confirmHold: {
  123. type: Boolean,
  124. default: false
  125. },
  126. // 文本样式
  127. textStyle: {
  128. type: [Object, String],
  129. default: () => {}
  130. },
  131. // 统计数字的样式
  132. countStyle: {
  133. type: [Object, String],
  134. default: () => {}
  135. },
  136. ...uni.$uv?.props?.textarea
  137. }
  138. }