We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
当upload的值有两个相同url的时候,即使删除的是最后一个,但是结果会删除第一个
阅读源码发现在代码中删除是使用 url作为key值,这显然在多个相同url的时候进行删除的时候就会有问题。并且原来的代码中也没有一个设置key值的机会
vue-vben-admin/src/components/Upload/src/components/UploadPreviewModal.vue
Lines 82 to 84 in e69dd1e
vue-vben-admin/src/components/Upload/src/components/data.tsx
Lines 83 to 85 in e69dd1e
稍等会提一个pr,预计是broken change的(因为要引入uid取代掉用url作为key值)。下面的代码是一个复现示例,当第一个和第三个的值相同的时候,点击删除第三个,预期是删除掉第三个。但是结果是把第一个删掉了,
<template> <Alert message="bug" /> <BasicForm @register="registerValiate" class="my-5" /> </template> <script setup lang="ts"> import { Alert } from 'ant-design-vue'; import { BasicForm, FormSchema, useForm } from '@/components/Form'; import { useMessage } from '@/hooks/web/useMessage'; import { uploadApi } from '@/api/sys/upload'; const { createMessage } = useMessage(); const schemasValiate: FormSchema[] = [ { field: 'field1', component: 'Upload', label: '字段1', defaultValue: [ 'https://avatars.githubusercontent.com/u/1', 'https://avatars.githubusercontent.com/u/2', 'https://avatars.githubusercontent.com/u/1', ], componentProps: { api: uploadApi, maxNumber: 3, }, }, ]; const [registerValiate, { getFieldsValue: getFieldsValueValiate, validate }] = useForm({ labelWidth: 160, schemas: schemasValiate, actionColOptions: { span: 18, }, submitFunc: () => { return new Promise((resolve) => { validate() .then(() => { resolve(); console.log(getFieldsValueValiate()); createMessage.success(`请到控制台查看结果`); }) .catch(() => { createMessage.error(`请输入必填项`); }); }); }, }); </script>
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
当upload的值有两个相同url的时候,即使删除的是最后一个,但是结果会删除第一个
阅读源码发现在代码中删除是使用 url作为key值,这显然在多个相同url的时候进行删除的时候就会有问题。并且原来的代码中也没有一个设置key值的机会
vue-vben-admin/src/components/Upload/src/components/UploadPreviewModal.vue
Lines 82 to 84 in e69dd1e
vue-vben-admin/src/components/Upload/src/components/data.tsx
Lines 83 to 85 in e69dd1e
稍等会提一个pr,预计是broken change的(因为要引入uid取代掉用url作为key值)。下面的代码是一个复现示例,当第一个和第三个的值相同的时候,点击删除第三个,预期是删除掉第三个。但是结果是把第一个删掉了,
Reproduction
The text was updated successfully, but these errors were encountered: