提交 ecfb3f8f 编写于 作者: Q qiang

chore: build

上级 a3334254
...@@ -15339,11 +15339,10 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -15339,11 +15339,10 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
watchEffect(() => { watchEffect(() => {
iframe.src = getRealPath(props2.src); iframe.src = getRealPath(props2.src);
}); });
_resize = useWebViewSize(rootRef, iframe, props2.fullscreen); iframeRef.value = iframe;
_resize = useWebViewSize(rootRef, iframeRef, props2.fullscreen);
if (props2.fullscreen) { if (props2.fullscreen) {
document.body.appendChild(iframe); document.body.appendChild(iframe);
} else {
iframeRef.value = iframe;
} }
}; };
renderIframe(); renderIframe();
...@@ -15353,13 +15352,13 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -15353,13 +15352,13 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
!props2.fullscreen && ((_a = rootRef.value) == null ? void 0 : _a.appendChild(iframeRef.value)); !props2.fullscreen && ((_a = rootRef.value) == null ? void 0 : _a.appendChild(iframeRef.value));
}); });
onActivated(() => { onActivated(() => {
iframeRef.value && (iframeRef.value.style.display = "block"); props2.fullscreen && (iframeRef.value.style.display = "block");
}); });
onDeactivated(() => { onDeactivated(() => {
iframeRef.value && (iframeRef.value.style.display = "none"); props2.fullscreen && (iframeRef.value.style.display = "none");
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
iframeRef.value && document.body.removeChild(iframeRef.value); props2.fullscreen && document.body.removeChild(iframeRef.value);
}); });
return () => { return () => {
return createVNode(Fragment, null, [createVNode("uni-web-view", mergeProps({ return createVNode(Fragment, null, [createVNode("uni-web-view", mergeProps({
...@@ -15372,7 +15371,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -15372,7 +15371,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
}; };
} }
}); });
function useWebViewSize(rootRef, iframe, fullscreen) { function useWebViewSize(rootRef, iframeRef, fullscreen) {
const _resize = () => { const _resize = () => {
var _a, _b; var _a, _b;
if (fullscreen) { if (fullscreen) {
...@@ -15382,7 +15381,7 @@ function useWebViewSize(rootRef, iframe, fullscreen) { ...@@ -15382,7 +15381,7 @@ function useWebViewSize(rootRef, iframe, fullscreen) {
width, width,
height height
} = rootRef.value.getBoundingClientRect(); } = rootRef.value.getBoundingClientRect();
updateElementStyle(iframe, { updateElementStyle(iframeRef.value, {
position: "absolute", position: "absolute",
display: "block", display: "block",
border: "0", border: "0",
...@@ -15392,7 +15391,7 @@ function useWebViewSize(rootRef, iframe, fullscreen) { ...@@ -15392,7 +15391,7 @@ function useWebViewSize(rootRef, iframe, fullscreen) {
height: height + "px" height: height + "px"
}); });
} else { } else {
updateElementStyle(iframe, { updateElementStyle(iframeRef.value, {
width: ((_a = rootRef.value) == null ? void 0 : _a.style.width) || "300px", width: ((_a = rootRef.value) == null ? void 0 : _a.style.width) || "300px",
height: ((_b = rootRef.value) == null ? void 0 : _b.style.height) || "150px" height: ((_b = rootRef.value) == null ? void 0 : _b.style.height) || "150px"
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册