28 lines
433 B
Vue
28 lines
433 B
Vue
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
imageUrl: string
|
|
}>()
|
|
|
|
function download() {
|
|
const a = document.createElement('a')
|
|
a.href = props.imageUrl
|
|
a.download = 'image.png'
|
|
a.click()
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<img id="image_" :src="imageUrl">
|
|
<div my-2 w-full>
|
|
<Button class="w-2/3" @click="download">
|
|
下载
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|