Skip to content

Commit

Permalink
timeline moment去除跳转默认行为
Browse files Browse the repository at this point in the history
  • Loading branch information
hanaTsuk1 committed Aug 31, 2024
1 parent 913d07d commit b8bd8e2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/timeline/graph/TimelineMoment.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import { open } from '@tauri-apps/plugin-shell'
import type { ObsidianNote } from '@/hooks/useObsidian'
import type { TimeLineNodeCommonGraphData } from '@/interfaces'
Expand All @@ -10,16 +12,24 @@ const props = defineProps<{
defineOptions({
inheritAttrs: false,
})
function openObsidian() {
open(`obsidian://open?path=${props.raw.path}`)
}
</script>

<template>
<a v-bind="$attrs" :href="`obsidian://open?path=${props.raw.path}`">
<div i-mdi:pencil />
<div v-bind="$attrs" i-mdi:pencil cursor-pointer @click="openObsidian">
<v-tooltip activator="parent" :text="$t('timelineGraph.moment.tooltip')" location="start" />
</a>
</div>
<div>
<div class="line-clamp-1" break-all>
<div :class="props.data.children ? 'line-clamp-2' : 'line-clamp-1'" break-all>
{{ props.data.title }}
</div>
<div v-if="props.data.children">
{{ $t('timelineGraph.includeCount', {
count: props.data.children,
}) }}
</div>
</div>
</template>

0 comments on commit b8bd8e2

Please sign in to comment.