Change click type

This commit is contained in:
2024-09-04 20:05:57 +02:00
parent b7a1f0e3e7
commit a855b63d46
2 changed files with 6 additions and 5 deletions

View File

@@ -51,7 +51,6 @@ function openDeleteTabModal(tab: TabType) {
function visitLink(clickType: 'self' | 'extern') {
if (!props.editMode) {
window.open(props.tab.link, clickType === 'self' ? '_self' : '_blank')
// todo: add view count
}
}
</script>

View File

@@ -27,9 +27,8 @@ onMounted(() => {
}
})
function visitLink(link: string) {
window.open(link, '_blank')
// todo: add view count
function visitLink(clickType: 'self' | 'extern') {
window.open(props.tab.link, clickType === 'self' ? '_self' : '_blank')
}
</script>
@@ -105,7 +104,10 @@ function visitLink(link: string) {
body: { base: 'cursor-pointer h-full relative z-20' },
background: 'h-full duration-300 bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800',
}"
@click.prevent="visitLink(tab.link)"
@click.left="visitLink('self')"
@click.right="visitLink('extern')"
@click.prevent="visitLink('self')"
@click.middle="visitLink('extern')"
>
<div v-show="tab.primary" class="absolute flex h-3 w-3 -left-1 -top-1">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full opacity-75" :class="`bg-${tab.color}-400`" />