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