Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find element in cloned iframe #327

Closed
Halecoder opened this issue Jun 20, 2024 · 1 comment
Closed

Unable to find element in cloned iframe #327

Halecoder opened this issue Jun 20, 2024 · 1 comment

Comments

@Halecoder
Copy link

const getThumbnail = async () => {
  const graphInstance = graphRef.value!.getInstance();
  const thumbnail = await graphInstance.getImageBase64();
  return thumbnail;
};

获取base64为空,我在vue3的onBeforeUnmount钩子调用

@seeksdream
Copy link
Owner

<a>
  <b>
  </b>
</a>

按道理是这样的:
a.onBeforeUnmount
b.onBeforeUnmount
但a.onBeforeUnmount使用了异步函数,vue并不会等这些异步函数被执行完了才卸载b,也就是说getThumbnail方法还没开始执行图谱组件就已经被卸载了。
而你的a.onBeforeUnmount中的截图功能需要使用到b的dom,所以肯定是不行的。

加上截图是一个耗时的操作,所以想要实现在退出时获取最新截图的功能,这样简单的处理思路可能是不行的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants