mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-02-02 18:08:40 +08:00
fix(upload): ensure the value type is correct
修复BasicUpload组件在设置null值时的问题
This commit is contained in:
parent
7b76945bff
commit
05329ce950
@ -6,6 +6,7 @@
|
||||
- 新增`headerTop`插槽
|
||||
- **AppSearch** 修复可能会搜索隐藏菜单的问题
|
||||
- **TableAction** 仅在 action.tooltip 存在的情况下 才包裹 Tooltip 组件
|
||||
- **BasicUpload** 修复处理非`array`值时报错的问题
|
||||
- **其它**
|
||||
- 修复菜单默认折叠的配置不起作用的问题
|
||||
- 修复`safari`浏览器报错导致网站打不开
|
||||
|
@ -46,6 +46,7 @@
|
||||
import { uploadContainerProps } from './props';
|
||||
import { omit } from 'lodash-es';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { isArray } from '/@/utils/is';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'BasicUpload',
|
||||
@ -77,7 +78,7 @@
|
||||
watch(
|
||||
() => props.value,
|
||||
(value = []) => {
|
||||
fileList.value = value;
|
||||
fileList.value = isArray(value) ? value : [];
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
@ -20,6 +20,7 @@
|
||||
import { downloadByUrl } from '/@/utils/file/download';
|
||||
import { createPreviewColumns, createPreviewActionColumn } from './data';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { isArray } from '/@/utils/is';
|
||||
|
||||
export default defineComponent({
|
||||
components: { BasicModal, FileList },
|
||||
@ -33,6 +34,7 @@
|
||||
watch(
|
||||
() => props.value,
|
||||
(value) => {
|
||||
if (!isArray(value)) value = [];
|
||||
fileListRef.value = value
|
||||
.filter((item) => !!item)
|
||||
.map((item) => {
|
||||
|
Loading…
Reference in New Issue
Block a user