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

[小程序 uniapp环境] 无法挂载到canvas如何解决 #47

Open
2321605193 opened this issue Aug 18, 2023 · 1 comment
Open

[小程序 uniapp环境] 无法挂载到canvas如何解决 #47

2321605193 opened this issue Aug 18, 2023 · 1 comment

Comments

@2321605193
Copy link

项目环境:uniapp + vue3 +script-setup + vite

现象:等canvas渲染完成后,在初始化leafer,提示无法找到canvas,但实际是canvas已经渲染

排查:eventer需要传入this才行,

问题:传入vue3的proxy 还是报错

规避:使用uniapp 中的 getCurrentPages,且必须在pages的第一个页面下,无法在子组件中使用

const pages = getCurrentPages();

leaferImageLayer.value = new Leafer({
            view: canvasId,
            width: clientWidth.value,
            height: clientHeight.value,
            eventer: pages[pages.length - 1],
         
        });

期望:看下后续是否能够兼容uniapp vue3

@leaferjs
Copy link
Owner

收到,谢谢反馈~

@leaferjs leaferjs changed the title [小程序] 无法挂载到canvas如何解决 [小程序 uniapp环境] 无法挂载到canvas如何解决 Jul 12, 2024
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