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.

127 lines
3.5 KiB

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