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

upload 上传图片组件,fileList url无后缀时,图片不回显 #4198

Closed
wei1034937343 opened this issue Dec 14, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@wei1034937343
Copy link

TuSimple/naive-ui version (版本)

2.34.2

Vue version (Vue 版本)

3.2.45

Browser and its version (浏览器及其版本)

Edge

System and its version (系统及其版本)

Window11

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/quizzical-bash-gy87jn

Reappearance steps (重现步骤)

fileList 字段中,传入的url 不包含文件后缀名时,图片不能正常显示

Expected results (期望的结果)

fileList 字段中,传入的url 不包含文件后缀名时,图片也应该正常显示

Actual results (实际的结果)

fileList 字段中,传入的url 不包含文件后缀名时,图片不能正常显示

Remarks (补充说明)

image

@github-actions github-actions bot added the untriaged need to sort label Dec 14, 2022
@thibodeauxjl
Copy link

thibodeauxjl commented Dec 17, 2022

fileList: ref<UploadFileInfo[]>([
    {
          id: 'c',
          name: '我是自带url的图片.png',
          status: 'finished',
          url: 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132',
          type: 'image/jpeg',
    },
]

Without the file extension, you have to include a file type.

@07akioni 07akioni added feature request New feature or request bug Something isn't working and removed untriaged need to sort feature request New feature or request labels Dec 18, 2022
@thibodeauxjl
Copy link

You have code on how you're trying to view it? In the above code sandbox I can replace the bottom image preview and it shows.

previewFileList: ref<UploadFileInfo[]>([
        {
          id: 'react',
          name: '我是react.png',
          status: 'finished',
          url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
        },
        {
          id: 'vue',
          name: '我是vue.png',
          status: 'finished',
          url: 'https://aliyunoss.helaodash.com/uploads/images/4b/d98a474270c94eed7b2f2b23228a71.jpg?x-oss-process=image/resize,m_lfit,w_150,limit_0/auto-orient,1/quality,q_90',
          type: 'image/jpeg'
        }
      ])

image

@zxysilent
Copy link

Yes, it's my fault. It can run normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants