user-data-edit.ts 813 B

1234567891011121314151617181920212223242526272829303132
  1. import DictionariesBehavior from "../../../../core/behavior/dictionaries.behavior";
  2. // module/user/components/user-data-edit/user-data-edit.ts
  3. Component({
  4. behaviors: ['wx://form-field-group', DictionariesBehavior],
  5. lifetimes: {
  6. attached() {
  7. console.log('渲染');
  8. }
  9. },
  10. properties: {
  11. model: { type: Object, value: {} },
  12. sex: { type: String, value: '' },
  13. retractable: { type: Boolean, value: false },
  14. dirty: { type: Boolean, value: false },
  15. },
  16. data: {
  17. expanded: false,
  18. showSpecialPeriodPicker: true,
  19. },
  20. observers: {
  21. 'model.sex, sex'(value, sex) {
  22. const showSpecialPeriodPicker = value === '1' || sex === '1';
  23. this.setData({ showSpecialPeriodPicker })
  24. }
  25. },
  26. methods: {
  27. onExpand() {
  28. this.setData({ expanded: true });
  29. }
  30. }
  31. })