perf: If args of setFieldsValue is empty, it will not be executed
parent
29ef568c5f
commit
17f3b4cf40
|
@ -7,6 +7,7 @@ import type { UploadFile } from 'ant-design-vue/lib/upload/interface'
|
|||
import { join } from 'lodash-es'
|
||||
import { PlusOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { buildShortUUID } from '@/utils/uuid'
|
||||
import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||
import { isArray, isNotEmpty, isUrl } from '@/utils/is'
|
||||
|
@ -32,25 +33,13 @@ const props = defineProps({
|
|||
type: Array,
|
||||
default: () => ['image/png', 'image/jpeg'],
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: () => false,
|
||||
},
|
||||
multiple: propTypes.bool.def(false),
|
||||
// 最大数量的文件
|
||||
maxCount: {
|
||||
type: Number,
|
||||
default: () => 1,
|
||||
},
|
||||
maxCount: propTypes.number.def(1),
|
||||
// 最小数量的文件
|
||||
minCount: {
|
||||
type: Number,
|
||||
default: () => 0,
|
||||
},
|
||||
minCount: propTypes.number.def(0),
|
||||
// 文件最大多少MB
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: () => 2,
|
||||
},
|
||||
maxSize: propTypes.number.def(5),
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change', 'update:value'])
|
||||
|
|
|
@ -113,6 +113,9 @@ export function useFormEvents({
|
|||
* @description: Set form value
|
||||
*/
|
||||
async function setFieldsValue(values: Recordable): Promise<void> {
|
||||
if (Object.keys(values).length === 0)
|
||||
return
|
||||
|
||||
const fields = getAllFields()
|
||||
|
||||
// key 支持 a.b.c 的嵌套写法
|
||||
|
|
Loading…
Reference in New Issue