通过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);
                });
            },

  

posted @ 2022-07-01 18:03  Li_ll  Views(131)  Comments(0Edit  收藏  举报