<script>
export default {
methos: {
refresh() {},
handleSubmit(){},
changeActive(){}
},
};
</script>
<div>
<div ref="mainComponent" :is="XXXXXX" />
</div>
<script>
export default {
methos: {
refresh() {
this.$nextTaick(() => {
let func = this.$refs.mainComponent.refresh;
if (typeof func === "function") {
func();
}
});
},
handleSubmit() {
let func = this.$refs.mainComponent.refresh;
if (typeof func === "function") {
func().then(() => {});
}
},
changeActive(diff, loadingName) {
this[loading] = true;
let funcName = diff === 1 ? "beforeNext" : "beforePrve";
let funcObj = this.$refs.mainComponent[funcName];
if (typeof funcObj === "function") {
func().then(() => {
}).catch((error)=>{
this[loading] = false;
})
}
},
},
};
</script>