-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Taro.getImageInfo API 在 web( h5 ) 不能使用, 与文档不符 #3087
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
升级到1.3.0-beta.2 |
nb 了,版本未发, 文档先行 , h5 报错:
还有,请问下getImageInfo 在小程序端要获取本地图片应该怎么写呢? 我图片在 |
这个错貌似是因为你的cli没有一起升级导致的 你的 |
也升级了哈, Taro v1.3.0-beta.3
调用: const ctx = Taro.createCanvasContext('post-canvas', this.$scope)
Taro.getImageInfo({
src: img.src,
}).then(res => {
ctx.drawImage(res.path, 0, 0, 750, 400, 750, 400)
ctx.draw();
}) |
嗯, 本地图片不用 我知道了, 图片必须引用才会编译进 dist , 但我这个图片只是在画布中才用啊 |
Hello~ 您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。 如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。 Good luck and happy coding~ |
问题描述
Taro.getImageInfo API 在 web( h5 ) 不能使用, 与 文档 不符。类似情况还有,请更新下文档,这样很浪费开发者时间啊。
复现步骤
web 环境调用 API
期望行为

文档和实际行为一致
报错信息

系统信息
Taro CLI 1.2.26 environment info:
System:
OS: Windows 10
Binaries:
Node: 12.2.0 - C:\Program Files\nodejs\node.EXE
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
补充信息
无
The text was updated successfully, but these errors were encountered: