import DictionariesBehavior from "../../../../core/behavior/dictionaries.behavior";

// module/user/components/user-data-edit/user-data-edit.ts
Component({
  behaviors: ['wx://form-field-group', DictionariesBehavior],
  lifetimes: {
    attached() {
      console.log('渲染');
    }
  },
  properties: {
    model: { type: Object, value: {} },
    sex: { type: String, value: '' },
    retractable: { type: Boolean, value: false },
    dirty: { type: Boolean, value: false },
  },
  data: {
    expanded: false,
    showSpecialPeriodPicker: true,
  },
  observers: {
    'model.sex, sex'(value, sex) {
      const showSpecialPeriodPicker = value === '1' || sex === '1';
      this.setData({ showSpecialPeriodPicker })
    }
  },
  methods: {
    onExpand() {
      this.setData({ expanded: true });
    }
  }
})