diff --git a/app/components/App/Tab.vue b/app/components/App/Tab.vue index 6902a7a..6a24391 100644 --- a/app/components/App/Tab.vue +++ b/app/components/App/Tab.vue @@ -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 } } diff --git a/app/pages/[user].vue b/app/pages/[user].vue index fc8e152..980e520 100644 --- a/app/pages/[user].vue +++ b/app/pages/[user].vue @@ -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') } @@ -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')" >