Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[t-upload] 图片上传使用request-method返回的url是blob链接会导致loading图标一直展示中 #4753

Open
mulingyuer opened this issue Nov 19, 2024 · 1 comment
Labels
💪🏻 enhancement New feature or request

Comments

@mulingyuer
Copy link

tdesign-vue-next 版本

1.10.3

重现链接

No response

重现步骤

<template>
  <t-upload
      ref="uploadRef"
      v-model="img"
      theme="image"
      accept="image/*"
      :show-thumbnail="true"
      :draggable="draggable"
      :request-method="requestMethod"
    >
</template>

<script setup lang="ts">
import type { UploadFile, UploadInstanceFunctions, UploadProps } from "tdesign-vue-next";

const img = defineModel({ type: Array as PropType<UploadProps["value"]>, required: true });

const requestMethod: UploadProps["requestMethod"] = async (file: UploadFile) => {
  return {
    status: "success",
    response: {
	    url: URL.createObjectURL(file.raw!)
    }
  };
}
</script>

当使用URL.createObjectURL将file对象转换成blob链接后,组件将一直显示loading状态,我尝试在response对象的files数组中,返回一个status为success并且进度条为100的UploadFile类型对象,结果还是loading一直展示中。

QQ20241119-174207

最后我不得不使用css进行隐藏:

.image-upload {
	:deep(.t-image__loading) {
		display: none;
	}
}

期望结果

我希望能正确展示loading,在blob链接时,它能不显示

实际结果

No response

框架版本

3.5.12

浏览器版本

131.0.6778.70

系统版本

win10

Node版本

v22.11.0

补充说明

No response

Copy link
Contributor

👋 @mulingyuer,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@uyarn uyarn added the 💪🏻 enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪🏻 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants