报错信息:
on-error TypeError: Cannot read properties of null (reading 'offsetWidth')
at uni-h5.es.js:7052:25
at callWithErrorHandling (vue.runtime.esm.js:1375:22)
at callWithAsyncErrorHandling (vue.runtime.esm.js:1384:21)
at HTMLDivElement.invoker (vue.runtime.esm.js:9729:9) object {}
uni-h5.es.js:7052:25:
function useResizeSensorUpdate(rootRef, emit2, reset) {
const size = reactive({
width: -1,
height: -1
});
watch(() => extend({}, size), (value) => emit2("resize", value));
return () => {
const rootEl = rootRef.value;
size.width = rootEl.offsetWidth;
size.height = rootEl.offsetHeight;
reset();
};
}
1 个回复
YUANRJ
请提供下测试工程