props.js 3.1 KB

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