JavaScript/vue.js/ref:修订间差异
来自康健生活
| 第30行: | 第30行: | ||
import ChildComponent from './ChildComponent.vue'; | import ChildComponent from './ChildComponent.vue'; | ||
... | ... | ||
// 类型推断 | // 类型推断 InstanceType<T> | ||
const comp = ref<InstanceType<typeof ChildComponent> | null>(null); | const comp = ref<InstanceType<typeof ChildComponent> | null>(null); | ||
onMounted(() => { | onMounted(() => { | ||