Skip to content

Commit 710ba72

Browse files
committed
Open link from list
1 parent a5789a4 commit 710ba72

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/TabItem.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Favicon :favicon="item.favicon" />
44
<div class="ml-10 flex-grow-2">
55
<div class="first-block">
6-
<p class="url">{{ item.url }}</p>
6+
<p class="url" @click="openUrl(item.url)">{{ item.url }}</p>
77
<p class="text-right time">{{ summaryTimeForTab }}</p>
88
</div>
99
<div class="second-block">
@@ -49,6 +49,11 @@ const percent = computed(() =>
4949
);
5050
5151
const styleForProgressBar = computed(() => `width: ${percent.value}%`);
52+
53+
function openUrl(url: string) {
54+
if (!url.startsWith('http')) url = `https://${url}`;
55+
window.open(url, '_blank');
56+
}
5257
</script>
5358

5459
<style scoped>

0 commit comments

Comments
 (0)