<template>
   <el-form style="width: 100%" :model="localitem" label-width="80px">
    <el-form-item label="api">
      <el-input @input="setData" v-model="localitem.attr.api" placeholder="文件上传地址" />
    </el-form-item>
    <br />
    <el-form-item label="大小">
      <el-input @input="setData" v-model="localitem.attr.maxSize" placeholder="文件限制" />
    </el-form-item>
    <br />
    <el-form-item label="数量">
      <el-input-number @change="setData" v-model="localitem.attr.maxCount" placeholder="请输入数字" />
    </el-form-item>
    <br />
    <el-form-item label="介绍">
      <el-input @input="setData" type="textarea" :rows="3" v-model="localitem.subtitle" />
    </el-form-item>
  </el-form>
</template>
<script setup>
import { defineProps, ref, defineEmits } from 'vue';
const props = defineProps({
  item: Object,
  index: String
});


const localitem = ref(JSON.parse(JSON.stringify(props.item)));
const emit = defineEmits(['change']);
const setData = () => {
    emit('change', localitem.value, props.index);
};

</script>

<style scoped>
</style>
