chore: 初始化项目仓库

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 21:27:39 +08:00
commit b7addb5c7a
50 changed files with 15964 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<script setup lang="ts">
const props = defineProps<{
src?: string
alt?: string
}>()
const route = useRoute()
const resolvedSrc = computed(() => {
if (!props.src) return ''
// 绝对路径直接用
if (props.src.startsWith('/') || props.src.startsWith('http')) return props.src
// 相对路径:基于当前路由拼接
const base = route.path.replace(/\/$/, '')
return `${base}/${props.src}`
})
</script>
<template>
<img :src="resolvedSrc" :alt="alt" loading="lazy" decoding="async" />
</template>