💄 Post path optimization

This commit is contained in:
2024-08-19 01:18:27 +08:00
parent ca253eb87b
commit b94e6906e1
8 changed files with 30 additions and 20 deletions

View File

@ -1,5 +1,5 @@
<template>
<v-card :to="`/posts/${props.post.id}`" class="mx-[2.5ch] mb-3">
<v-card :to="url" class="mx-[2.5ch] mb-3">
<v-card-text>
<div class="mb-3 flex flex-row gap-4">
<v-avatar :image="post.author?.avatar" />
@ -68,4 +68,6 @@
<script setup lang="ts">
const props = defineProps<{ post: any, forceShowContent?: boolean, noClickableAttachment?: boolean }>()
const config = useRuntimeConfig()
const url = computed(() => props.post.alias ? `/posts/${props.post.area_alias}/${props.post.alias}` : `/posts/${props.post.id}`)
</script>