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

html2canvas硬核解决跨域 | 念一 #34

Open
thomasliew opened this issue Nov 30, 2022 · 0 comments
Open

html2canvas硬核解决跨域 | 念一 #34

thomasliew opened this issue Nov 30, 2022 · 0 comments

Comments

@thomasliew
Copy link
Owner

http://www.nianyi.cc/2022/11/18/58089ea98e51.html

html2canvas无法生成部分图片本质原因是跨域, 后端好解决但是前端需要另辟蹊径: 123456789101112131415161718192021222324252627// 首先根据url动态创建canvas 画图 获取base64// 其次用base64替换掉之前的图片路径 即可显示 注意异步操作const handleImg2Base64 = (src: string) =>

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

No branches or pull requests

1 participant