feat: 添加 FreshImage 组件以动态更新图片链接

This commit is contained in:
feige996
2025-05-19 18:31:27 +08:00
parent f192f4ca6b
commit 49854948be
3 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
<template>
<img :src="freshUrl" :alt="alt" />
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
src: {
type: String,
required: true,
},
alt: {
type: String,
default: '',
},
})
const freshUrl = computed(() => {
return `${props.src}?t=${Date.now()}`
})
</script>