outputValue.vue
860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<template>
<div>
<img :src="imgUrl" alt="">
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute } from "vue-router";
import { djReq } from "../../utils/request";
interface Params {
id?: string
}
const route = useRoute();
let query: Params = {}
let imgUrl = ref('')
const getImgUrl = async () => {
console.log(query)
imgUrl.value = await djReq(
"dj.api.smartcarlife.daily.report.picture.select",
query
)
console.log(imgUrl.value)
}
onMounted(() => {
if (route.query) {
console.log(route.query)
query = route.query;
getImgUrl();
}
});
// const imgUrl = ref('https://dj.glsx.com.cn/rpc-dj-smartcarlife/temp/9b0e99f0-465e-443d-abb6-8d5d880a5e61%E5%BB%B6%E4%BF%9D%E9%97%A8%E5%BA%97%E4%BA%A7%E5%80%BCexcel.png')
</script>
<style scoped>
img {
width: 100%;
}
</style>