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

不支持ES动态导入 #368

Open
meiseayoung opened this issue Aug 4, 2023 · 4 comments
Open

不支持ES动态导入 #368

meiseayoung opened this issue Aug 4, 2023 · 4 comments

Comments

@meiseayoung
Copy link

import('eruda').then(eruda=>{
    eruda.init() //Error
})

image

@JingMatrix
Copy link

Try this

import("https://cdn.jsdelivr.net/npm/eruda").then(_imports => eruda.init())

This is because eruda defines globally an object window.eruda.

@vini123
Copy link

vini123 commented Aug 13, 2023 via email

@meiseayoung
Copy link
Author

Try this

import("https://cdn.jsdelivr.net/npm/eruda").then(_imports => eruda.init())

This is because eruda defines globally an object window.eruda.

Thx. This approach may be feasible, but it is not a formal solution

@master1lan
Copy link

2024留言,eruda可以支持es动态导入,使用方法如下:
import('eruda').then((eruda) => eruda.default.init());

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

4 participants