【发布时间】:2022-01-19 15:28:30
【问题描述】:
有一个组件的引用是这样的:
<template>
<custom-component
ref="func"
/>
</template>
<script setup>
const func = ref();
</script>
在组件内部有这样一个函数:
const helloWorld = () => {
console.log('hello World');
}
如何从父组件获得对 helloWorld 函数的访问权限?
【问题讨论】:
标签: typescript vue.js vuejs3 vue-composition-api