【发布时间】:2020-11-25 15:30:40
【问题描述】:
我有一个组件,它的模板是这样的:
<template>
<slot />
</template>
我正在尝试制作的功能大约是resize-observer-polyfill。
我正在尝试在mounted() 中获取this.$el,然后创建ResizeObserver 的实例。
但问题是,如果 slot 的内容是async-component,那么我无法正确获取this.$el。
我该如何解决这个问题?
【问题讨论】: