父组件
//引入子组件
<jyqk :selectData="selectData" ref="jyqk_ref"></jyqk>
import fxjy from "./components/fxjy.vue";
const jyqk_ref = ref<any>();
const change_data = (val: any) => {
jyqk_ref.value.getData();
}
子组件
type prop = {
selectData: any;
};
const propData = defineProps<prop>();
//暴露子组件
defineExpose({
getData,
});
标签:jyqk,const,vue3,组件,ref,any,传值
From: https://www.cnblogs.com/JaneLifeBlog/p/17869226.html