<template>
  <z-form-item :label-col="{ style: { width: '120px', paddingRight: '6px' } }" :required="formForm?.required === '1' " :label="basicForm?.titleName || '输入框'" class="z-form-item" :prop="basicForm.field">
    <z-input v-model:value="model[basicForm.field]" :value="formForm.value" :maxlength="formForm.max && formForm.max>0 ? formForm.max : ''" :disabled="formForm?.disabled ==='1'" :placeholder="formForm?.placeholder" />
  </z-form-item>
</template>
<script>
import { defineComponent, toRef, toRefs } from 'vue'
export default defineComponent({
  name: 'InputItem',
  props: {
    formProperty: {
      type: Object,
      default: undefined
    },
    basicProperty: {
      type: Object,
      default: undefined
    },
    formModel: {
      type: Object,
      default: undefined
    }
  },
  setup(props) {
    const basicForm = toRef(props, 'basicProperty')
    const formForm = toRef(props, 'formProperty')
    const model = props.formModel ? toRefs(props.formModel) : {}
    console.log(model, '---------------------------model-------input')

    return {
      basicForm,
      model,
      formForm
    }
  }
})

</script>
