Skip to content

Commit 7be4346

Browse files
committed
feat: add provider name to download picture
1 parent 021ec13 commit 7be4346

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

components/ResultItem.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ async function copyUrl() {
4040
</Badge>
4141
</span>
4242
<ul>
43-
<TokutenItem v-for="(item, i) in data.items" :title="data.title" :index="i" :data="item" />
43+
<TokutenItem
44+
v-for="(item, i) in data.items"
45+
:provider="data.provider"
46+
:title="data.title"
47+
:index="i"
48+
:data="item"
49+
/>
4450
</ul>
4551
</li>
4652
</template>

components/TokutenItem.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { toast } from 'vue-sonner';
66
import { Download, Copy, ClipboardCopy } from 'lucide-vue-next';
77
88
const props = defineProps<{
9+
provider: string;
910
title: string;
1011
index: number;
1112
data: DetailItem;
@@ -23,7 +24,7 @@ async function downloadImage() {
2324
// 创建 a 标签
2425
const a = document.createElement('a');
2526
a.href = url;
26-
a.download = `${props.title}_${props.index}`;
27+
a.download = `${props.title}_${props.provider}_${props.index}`;
2728
a.click();
2829
2930
// 清理

0 commit comments

Comments
 (0)