index.js 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // components/input/index.js
  2. Component({
  3. options: {
  4. lifetimes: true
  5. },
  6. /**
  7. * 组件的属性列表
  8. */
  9. properties: {
  10. value: "",
  11. placeholder: {
  12. type: String,
  13. value: "请输入"
  14. },
  15. type: {
  16. type: String,
  17. value: "text"
  18. },
  19. disabled: {
  20. type: Boolean,
  21. value: false
  22. },
  23. maxLength: {
  24. type: Number,
  25. value: 200
  26. },
  27. isAudit: {
  28. type: Boolean,
  29. value: false
  30. }
  31. },
  32. /**
  33. * 组件的初始数据
  34. */
  35. data: {},
  36. lifetimes: {
  37. attached: function() {},
  38. detached: function() {
  39. // 在组件实例被从页面节点树移除时执行
  40. }
  41. },
  42. /**
  43. * 组件的方法列表
  44. */
  45. methods: {
  46. getValue(e) {
  47. this.triggerEvent("change", e.detail.value);
  48. }
  49. }
  50. });