From ecfb3f8fa451a6e2595c29e4124bc8f8698aaec2 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 4 Aug 2022 20:58:36 +0800 Subject: [PATCH] chore: build --- packages/uni-h5/dist/uni-h5.es.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index 08db484e9..05a7f629c 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -15339,11 +15339,10 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ watchEffect(() => { iframe.src = getRealPath(props2.src); }); - _resize = useWebViewSize(rootRef, iframe, props2.fullscreen); + iframeRef.value = iframe; + _resize = useWebViewSize(rootRef, iframeRef, props2.fullscreen); if (props2.fullscreen) { document.body.appendChild(iframe); - } else { - iframeRef.value = iframe; } }; renderIframe(); @@ -15353,13 +15352,13 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ !props2.fullscreen && ((_a = rootRef.value) == null ? void 0 : _a.appendChild(iframeRef.value)); }); onActivated(() => { - iframeRef.value && (iframeRef.value.style.display = "block"); + props2.fullscreen && (iframeRef.value.style.display = "block"); }); onDeactivated(() => { - iframeRef.value && (iframeRef.value.style.display = "none"); + props2.fullscreen && (iframeRef.value.style.display = "none"); }); onBeforeUnmount(() => { - iframeRef.value && document.body.removeChild(iframeRef.value); + props2.fullscreen && document.body.removeChild(iframeRef.value); }); return () => { return createVNode(Fragment, null, [createVNode("uni-web-view", mergeProps({ @@ -15372,7 +15371,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -function useWebViewSize(rootRef, iframe, fullscreen) { +function useWebViewSize(rootRef, iframeRef, fullscreen) { const _resize = () => { var _a, _b; if (fullscreen) { @@ -15382,7 +15381,7 @@ function useWebViewSize(rootRef, iframe, fullscreen) { width, height } = rootRef.value.getBoundingClientRect(); - updateElementStyle(iframe, { + updateElementStyle(iframeRef.value, { position: "absolute", display: "block", border: "0", @@ -15392,7 +15391,7 @@ function useWebViewSize(rootRef, iframe, fullscreen) { height: height + "px" }); } else { - updateElementStyle(iframe, { + updateElementStyle(iframeRef.value, { width: ((_a = rootRef.value) == null ? void 0 : _a.style.width) || "300px", height: ((_b = rootRef.value) == null ? void 0 : _b.style.height) || "150px" }); -- GitLab