props.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. export const commonProps = {
  2. value: {
  3. type: String,
  4. observer(value) {
  5. if (value !== this.value) {
  6. this.setData({ innerValue: value });
  7. this.value = value;
  8. }
  9. },
  10. },
  11. placeholder: String,
  12. placeholderStyle: String,
  13. placeholderClass: String,
  14. disabled: Boolean,
  15. maxlength: {
  16. type: Number,
  17. value: -1,
  18. },
  19. cursorSpacing: {
  20. type: Number,
  21. value: 50,
  22. },
  23. autoFocus: Boolean,
  24. focus: Boolean,
  25. cursor: {
  26. type: Number,
  27. value: -1,
  28. },
  29. selectionStart: {
  30. type: Number,
  31. value: -1,
  32. },
  33. selectionEnd: {
  34. type: Number,
  35. value: -1,
  36. },
  37. adjustPosition: {
  38. type: Boolean,
  39. value: true,
  40. },
  41. holdKeyboard: Boolean,
  42. };
  43. export const inputProps = {
  44. type: {
  45. type: String,
  46. value: 'text',
  47. },
  48. password: Boolean,
  49. confirmType: String,
  50. confirmHold: Boolean,
  51. };
  52. export const textareaProps = {
  53. autoHeight: Boolean,
  54. fixed: Boolean,
  55. showConfirmBar: {
  56. type: Boolean,
  57. value: true,
  58. },
  59. disableDefaultPadding: {
  60. type: Boolean,
  61. value: true,
  62. },
  63. };