mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-24 15:19:37 +08:00
✨ Feature(custom): refactor all main ipc event
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { onMounted, onUnmounted } from 'vue'
|
||||
|
||||
import { openURL } from '@/utils/common'
|
||||
import { sendRPC } from '@/utils/common'
|
||||
import { IRPCActionType } from 'root/src/universal/types/enum'
|
||||
|
||||
export function useATagClick () {
|
||||
const handleATagClick = (e: MouseEvent) => {
|
||||
if (e.target instanceof HTMLAnchorElement) {
|
||||
if (e.target.href) {
|
||||
e.preventDefault()
|
||||
openURL(e.target.href)
|
||||
sendRPC(IRPCActionType.OPEN_URL, e.target.href)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user