通过ref调取子组件方法
子
async update(res){ //this.$refs.child.animates(); this.userform = res; },
主
<DetailEdit @detailData="func" ref="dadjCKDASYXXEdit" :addType="resultType == 'edit' ? 'bigedit' : 'bigadd'" editType="main" :initOpen="true" :dataform="CKDASYXX" /> getDetails(){ this.$hd.api.get({ url:"core/zsjgl/pbccmsyl/pbclmx/List", params:{ "id": this.details.pkid } }).then((res) =>{ const data=[...res]; this.CKDASYXX = data; //这一句 this.$refs.dadjCKDASYXXEdit.update(data) // this.$emit('close',this.userform); }); },