region-picker.js 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // components/region-picker/region-picker.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. options: {
  7. addGlobalClass: true,
  8. },
  9. properties: {
  10. label: {
  11. type: String,
  12. value: '',
  13. },
  14. formid: {
  15. type: String,
  16. value: '',
  17. },
  18. forminfo: {
  19. type: Object,
  20. value: {}
  21. }
  22. },
  23. behaviors: ['wx://component-export'],
  24. /**
  25. * 组件的初始数据
  26. */
  27. data: {
  28. input_text: '',
  29. },
  30. //组件最终对外导出的数据
  31. export() {
  32. return {
  33. input_text: this.data.input_text,
  34. force: this.properties.forminfo.force,
  35. role: this.properties.forminfo.role }
  36. },
  37. /**
  38. * 组件的方法列表
  39. */
  40. methods: {
  41. bindPickerChange: function (e) {
  42. console.log(e);
  43. this.setData({ //给变量赋值
  44. input_text: e.detail.value
  45. })
  46. }
  47. }
  48. })