the modal component of iview is used, and the content of modal customized by render is used. The code is as follows
cz (index) {
this.$Modal.info(
{
render: (h) => {
return h(Cz,{
props:{
index:index,
data1:this.data1,
}
})
},
title:"",
closable:true,
okText:"",
onOk(){
console.log()
},
})
},
Sub-component code
<template>
<Form :label-width="80" ref="addForm">
<FormItem label="">
<Input type="text" :value="data1[index]["name"]" v-bind:readonly="true"></Input>
</FormItem>
<FormItem label="">
<Input type="text" :value="data1[index]["phone"]" v-bind:readonly="true"></Input>
</FormItem>
<FormItem label="">
<Input v-model="yen" type="text" placeholder=""></Input>
</FormItem>
<FormItem label="">
<Input type="text" value="" ></Input>
</FormItem>
</Form>
</template>
<script>
export default {
name: "cz",
props:{
index:{
},
data1:{
},
},
data(){
return {
yen:""
}
},
methods:{
},
watch:{
yen:function (data) {
console.log(data);
}
}
}
</script>
<style scoped>
</style>
because of the render rendering used, it seems that the ref binding cannot be used to retrieve the median values of the subcomponents.
aim to get the median value of the form form in the child component through the onOK () method of the parent component, and ask for your advice! Thank you