refine: upload 还是返回一个url吧

This commit is contained in:
菲鸽
2024-05-15 10:12:40 +08:00
parent 5b16ebe1fe
commit ef83c31b8b
2 changed files with 5 additions and 8 deletions

View File

@@ -13,16 +13,16 @@
<view v-if="loading" class="text-blue h-10">上传...</view>
<template v-else>
<view class="m-2">上传后返回的接口数据</view>
<view class="m-2">{{ JSON.stringify(data) }}</view>
<view class="m-2">{{ data }}</view>
<view class="h-80 w-full">
<image v-if="data" :src="data.url || data" mode="scaleToFill" />
<image v-if="data" :src="data || data" mode="scaleToFill" />
</view>
</template>
</view>
</template>
<script lang="ts" setup>
const { loading, data, run } = useUpload<any>({ user: '菲鸽' })
const { loading, data, run } = useUpload({ user: '菲鸽' })
</script>
<style lang="scss" scoped>