feat: add standalone memos
ci / gitleaks (push) Successful in 10s
ci / docker (push) Successful in 3m38s

This commit is contained in:
2026-09-12 10:22:35 +08:00
parent e07a1de1f5
commit 31c2218edc
18 changed files with 1063 additions and 13 deletions
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
import { computed } from 'vue'
export type MemoListItem = { id: string; title: string; excerpt: string; version: number; created_at: string; updated_at: string; deleted_at: string | null }
const props = defineProps<{ memo: MemoListItem; active?: boolean }>()
const emit = defineEmits<{ select: [id: string] }>()
const excerpt = computed(() => props.memo.excerpt.replace(/\s+/g, ' ').trim())
const updated = new Intl.DateTimeFormat('zh-CN', { month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' }).format(new Date(props.memo.updated_at))
</script>
<template>
<button class="memo-row" :class="{ active }" :aria-current="active ? 'true' : undefined" @click="emit('select', memo.id)">
<strong>{{ memo.title }}</strong>
<span class="memo-row__excerpt">{{ excerpt || '暂无正文' }}</span>
<time :datetime="memo.updated_at">{{ updated }}</time>
</button>
</template>