Skip to content

Commit

Permalink
fix(ui): img组件没有配置url是点击页面刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen authored and jia000 committed Jun 6, 2022
1 parent 70292b9 commit 5d159ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ui-react/src/img/Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Img: React.FC<ImgProps> = ({ config }) => {
if (!app) return null;

const clickHandler = () => {
window.location.href = config.url;
if (config.url) window.location.href = config.url;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-vue2/src/img/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
};
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/img/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
};
},
Expand Down

0 comments on commit 5d159ad

Please sign in to comment.