在这个页面中,如何实现在点击按钮的时候将上面的input的值传给下面的表格组件?
<template>
<el-row :gutter="20">
<el-col :xs="24" :lg="24" class="mb20">
<el-form-item ref="ApplicantType_FormItem" prop="ApplicantType" label="申请人类型">
<el-radio-group v-model="stateApplicant.Entity.ApplicantType" @change="onAppTypeChanged" clearable>
<el-radio-button key="Person" value="Person" label=Person>自然人</el-radio-button>
<el-radio-button key="Company" value="Company" label=Company>法人</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :lg="12" class="mb20">
<el-form-item ref="Applicant_FormItem" prop="Entity.Applicant" label="申请人">
<el-input v-model="stateApplicant.Entity.Applicant" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :xs="24" :lg="24" class="mb20">
<div>
<el-button type="primary" @click="addApplicant">添加申请人</el-button>
</div>
<MyTable ref="appLicanttableRef" v-bind="appLicantData" v-model="props.SubModel" />
</el-col>
</el-row>
</template>
<script setup lang="ts" name="申请人信息;false;">
import { ref, reactive, onMounted, computed } from 'vue';
const appLicanttableRef = ref()
const appLicantData = ref(
{
// 列表数据(必传)
data: [] as any,
// 表头内容(必传,注意格式)
header: [
{ title: '申请人', key: 'Applicant', type: 'text', isCheck: true },
{ title: '申请人类型', key: 'ApplicantType', type: 'text', isCheck: false },
],
// 配置项(必传)
config: {
total: 0, // 列表总数
loading: true, // loading 加载
isSerialNo: true, // 是否显示表格序号
isSelection: true, // 是否显示表格多选
isOperate: true, // 是否显示表格操作栏
isSub: true,
showAddBtn: false
}
}
);
const stateApplicant = reactive({
Entity: {
Applicant: null,
ApplicantType: 'Person',
},
});
const addApplicant = () => {
};
</script>