You've already forked obsidian-visualiser
Add tag page and fix mobile header
This commit is contained in:
@@ -6,7 +6,7 @@ interface ParsedContentExtended extends Omit<ParsedContent, 'body'> {
|
||||
body: MarkdownRoot | CanvasContent | null;
|
||||
}
|
||||
|
||||
const tags = inject('tags') as ParsedContent;
|
||||
const tags = inject('tags/descriptions') as ParsedContent;
|
||||
const props = defineProps({
|
||||
href: {
|
||||
type: String,
|
||||
@@ -109,6 +109,10 @@ function showPreview(e: Event, bbox: boolean) {
|
||||
if(content.value === null)
|
||||
loadContent();
|
||||
}
|
||||
function showTag(e: Event)
|
||||
{
|
||||
//e.preventDefault();
|
||||
}
|
||||
function hidePreview(e: Event) {
|
||||
timeout = setTimeout(() => hovered.value = false, 300);
|
||||
}
|
||||
@@ -116,8 +120,8 @@ function hidePreview(e: Event) {
|
||||
|
||||
<template >
|
||||
<template v-if="href !== ''">
|
||||
<NuxtLink custom no-prefetch v-slot="{ href: hrefSlot, navigate }" :href="isTag ? undefined : { path: content?._path ?? link, hash: anchor }" :target="target">
|
||||
<a :href="hrefSlot" @click="(isTag ? (e: Event) => e.preventDefault() : navigate)" @mouseenter="(e) => showPreview(e, true)" @mouseleave="hidePreview" v-bind="$attrs"><slot ></slot></a>
|
||||
<NuxtLink custom no-prefetch v-slot="{ href: hrefSlot, navigate }" :href="isTag ? { path: '/tags/' + anchor.substring(1) } : { path: content?._path ?? link, hash: anchor }" :target="target">
|
||||
<a :href="hrefSlot" @click="navigate" @mouseenter="(e) => showPreview(e, true)" @mouseleave="hidePreview" v-bind="$attrs"><slot></slot></a>
|
||||
</NuxtLink>
|
||||
<Teleport to="body" v-if="hovered && (loading || !!content)">
|
||||
<div class="popover hover-popover is-loaded" :style="pos" @mouseenter="(e) => showPreview(e, false)" @mouseleave="hidePreview">
|
||||
|
||||
Reference in New Issue
Block a user