perf: 使用封装的vben/utils工具类 替换 windows.open
							parent
							
								
									d92972ba3e
								
							
						
					
					
						commit
						60bd4a13b1
					
				|  | @ -1,5 +1,6 @@ | ||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import { isDocAlertEnable } from '@vben/hooks'; | import { isDocAlertEnable } from '@vben/hooks'; | ||||||
|  | import { openWindow } from '@vben/utils'; | ||||||
| 
 | 
 | ||||||
| import { Alert, Typography } from 'ant-design-vue'; | import { Alert, Typography } from 'ant-design-vue'; | ||||||
| 
 | 
 | ||||||
|  | @ -18,7 +19,7 @@ const props = defineProps<DocAlertProps>(); | ||||||
| 
 | 
 | ||||||
| /** 跳转 URL 链接 */ | /** 跳转 URL 链接 */ | ||||||
| const goToUrl = () => { | const goToUrl = () => { | ||||||
|   window.open(props.url); |   openWindow(props.url); | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import { useVbenModal, VbenButton, VbenButtonGroup } from '@vben/common-ui'; | import { useVbenModal, VbenButton, VbenButtonGroup } from '@vben/common-ui'; | ||||||
|  | import { openWindow } from '@vben/utils'; | ||||||
| 
 | 
 | ||||||
| import { Image, Tag } from 'ant-design-vue'; | import { Image, Tag } from 'ant-design-vue'; | ||||||
| 
 | 
 | ||||||
|  | @ -13,10 +14,6 @@ const [Modal, modalApi] = useVbenModal({ | ||||||
|     modalApi.close(); |     modalApi.close(); | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| 
 |  | ||||||
| function openWindow(url: string) { |  | ||||||
|   window.open(url, '_blank'); |  | ||||||
| } |  | ||||||
| </script> | </script> | ||||||
| <template> | <template> | ||||||
|   <Modal class="w-[40%]" :title="$t('ui.widgets.qa')"> |   <Modal class="w-[40%]" :title="$t('ui.widgets.qa')"> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 xingyu4j
						xingyu4j