提交 05329ce9 编写于 作者: 无木

fix(upload): ensure the value type is correct

修复BasicUpload组件在设置null值时的问题
上级 7b76945b
......@@ -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) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册