From 5d159ad9d8b7c1dc08ea186fbb96a76d2f9f9856 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Mon, 6 Jun 2022 14:12:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20img=E7=BB=84=E4=BB=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=85=8D=E7=BD=AEurl=E6=98=AF=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui-react/src/img/Img.tsx | 2 +- packages/ui-vue2/src/img/src/index.vue | 2 +- packages/ui/src/img/src/index.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui-react/src/img/Img.tsx b/packages/ui-react/src/img/Img.tsx index fa132790..43a678f9 100644 --- a/packages/ui-react/src/img/Img.tsx +++ b/packages/ui-react/src/img/Img.tsx @@ -35,7 +35,7 @@ const Img: React.FC = ({ config }) => { if (!app) return null; const clickHandler = () => { - window.location.href = config.url; + if (config.url) window.location.href = config.url; } return ( diff --git a/packages/ui-vue2/src/img/src/index.vue b/packages/ui-vue2/src/img/src/index.vue index 722ff409..2e8e6f10 100644 --- a/packages/ui-vue2/src/img/src/index.vue +++ b/packages/ui-vue2/src/img/src/index.vue @@ -23,7 +23,7 @@ export default defineComponent({ useApp(props); return { clickHandler() { - window.location.href = props.config.url; + if (props.config.url) window.location.href = props.config.url; }, }; }, diff --git a/packages/ui/src/img/src/index.vue b/packages/ui/src/img/src/index.vue index 5e948d06..d143f08f 100644 --- a/packages/ui/src/img/src/index.vue +++ b/packages/ui/src/img/src/index.vue @@ -25,7 +25,7 @@ export default defineComponent({ return { clickHandler() { - window.location.href = props.config.url; + if (props.config.url) window.location.href = props.config.url; }, }; },