审查元素canvas的宽高是有的,但是你怎么把它设置了一个width=“0”,导致抛出异常。
新版本(2.6.5 20200314)存在的问题,老版本没这个问题。
index.umd.min.js?1c31:1 [system] DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
at VueComponent._resize (webpack-internal:///./node_modules/@dcloudio/uni-h5/dist/index.umd.min.js:1:410267)
at invokeWithErrorHandling (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:1864:26)
at VueComponent.invoker (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:2189:14)
at invokeWithErrorHandling (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:1864:26)
at VueComponent.Vue.$emit (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:3933:9)
at VueComponent.handler (webpack-internal:///./node_modules/@dcloudio/uni-h5/dist/index.umd.min.js:1:124793)
at Watcher.run (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:4619:19)
at flushSchedulerQueue (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:4361:13)
at Array.eval (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:1990:12)
at flushCallbacks (webpack-internal:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js:1916:14)