39 lines
763 B
Vue
Raw Normal View History

2024-05-03 14:13:22 +08:00
<route lang="json5" type="page">
{
layout: 'default',
style: {
2024-05-03 14:53:11 +08:00
navigationBarTitleText: '上传-状态一体化',
2024-05-03 14:13:22 +08:00
},
}
</route>
2025-06-20 12:12:21 +08:00
<script lang="ts" setup>
const { loading, data, run } = useUpload()
</script>
2024-05-03 14:13:22 +08:00
<template>
<view class="p-4 text-center">
2025-06-20 12:12:21 +08:00
<wd-button @click="run">
选择图片并上传
</wd-button>
<view v-if="loading" class="h-10 text-blue">
上传...
</view>
2024-05-03 14:13:22 +08:00
<template v-else>
2025-06-20 12:12:21 +08:00
<view class="m-2">
上传后返回的接口数据
</view>
<view class="m-2">
{{ data }}
</view>
2024-05-03 14:13:22 +08:00
<view class="h-80 w-full">
<image v-if="data" :src="data.url" mode="scaleToFill" />
2024-05-03 14:13:22 +08:00
</view>
</template>
</view>
</template>
<style lang="scss" scoped>
//
</style>