<template>
<div>
    <template v-if="type==='hsSelectPlus'">
      <hsSelectPlus
        :writeBackObject='formParms'
        v-model="value_inner"
        :allSourceData='item.allSourceData'
        :elInfo='elInfo'
        :readonly='disabled'
        :prop='item.prop'
        :containerType='containerType'
        >
      </hsSelectPlus>
    </template>
    <template v-if="type==='hsFile'">
      <hsFile
        v-model="value_inner"
         :allSourceData='item.allSourceData'
        :elInfo='elInfo'
        :readonly='disabled'
        :prop='item.prop'
        :containerType='containerType'
        >
      </hsFile>
    </template>
    <template v-if="type==='hsComputed'">
      <hsComputed
        v-model="value_inner"
       :allSourceData='item.allSourceData'
        :elInfo='elInfo'
        :readonly='disabled'
        :formData='formParms'
        :prop='item.prop'
        :containerType='containerType'
        >
      </hsComputed>
    </template>
    <template v-if="type==='hsInput'">
      <hsInput
        v-model="value_inner"
        :allSourceData='item.allSourceData'
        :elInfo='elInfo'
        :readonly='disabled'
        :formData='formParms'
        :prop='item.prop'
        :containerType='containerType'
        >
      </hsInput>
    </template>
</div>
</template>
<script>
export default {
  props: {
    item: {},
    containerType: {},
    formParms: {},
    type: '',
    value: '',
    elInfo: {},
    disabled: false
  },
  watch: {
    value: {
      handler(newValue, oldValue) {
        this.value_inner = newValue
      },
      deep: true
    },
    value_inner: {
      handler(newValue, oldValue) {
        this.$emit('input', newValue)
      },
      deep: true
    }
  },
  data() {
    return {
      value_inner: ''
    }
  },
  mounted() {
    this.value_inner = this.value
  }
}
</script>
