kjdskjk
This commit is contained in:
25
frontend/app/components/viewer/widgets/link/NoteLink.vue
Normal file
25
frontend/app/components/viewer/widgets/link/NoteLink.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { PushNote, GetNoteByName } from '~/services/Content';
|
||||
|
||||
const props = defineProps(['content'])
|
||||
|
||||
const parts = computed(() => props.content?.split('|') ?? [])
|
||||
|
||||
const href = computed(() => parts.value[0] || '')
|
||||
const text = computed(() => parts.value[1] || parts.value[0] || '')
|
||||
|
||||
|
||||
function handleClick() {
|
||||
// your custom logic here
|
||||
PushNote(GetNoteByName(href.value));
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a href="#" @click.prevent="handleClick">
|
||||
{{ text }}
|
||||
</a>
|
||||
</template>
|
||||
Reference in New Issue
Block a user