import { formInit } from '../const'

export const DetailMixins = {
  data() {
    return {
      form: {},
      formFunc: null,
    }
  },
  watch: {
    type: {
      immediate: true,
      handler(newV) {
        this.formFunc = formInit(newV)
      },
    },
    curInfo: {
      immediate: true,
      handler(newV) {
        this.form = this.formFunc(newV)
      },
    },
  },
  props: {
    curInfo: {
      type: Object,
      default: () => {},
    },
    type: {
      type: Number,
      defualt: null,
    },
  },
  methods: {
  },
}
