props.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. };