feat: base xtUpload初始化优化

This commit is contained in:
caoqianming 2025-12-05 11:23:54 +08:00
parent 0ba1160edc
commit 95c52117cc
1 changed files with 2 additions and 6 deletions

View File

@ -24,7 +24,7 @@ const emit = defineEmits(["update:modelValue", "update:obj"]);
const props = defineProps({ const props = defineProps({
xtype: { type: String, default: "path" }, // path id xtype: { type: String, default: "path" }, // path id
modelValue: { type: [Array, String], default: undefined }, modelValue: { type: [Array, String], default: "pending" },
obj: { type: Object, default: () => ({}) }, obj: { type: Object, default: () => ({}) },
accept: { type: String, default: '' }, accept: { type: String, default: '' },
countMax: { type: Number, default: 1 }, countMax: { type: Number, default: 1 },
@ -44,18 +44,14 @@ const action = `${config.baseUrl}/file/`
const inited = ref(false) const inited = ref(false)
onMounted(() => { onMounted(() => {
disabled.value = true
checkPropsUntilReady() checkPropsUntilReady()
}) })
const checkPropsUntilReady = () => { const checkPropsUntilReady = () => {
if (inited.value) return if (inited.value) return
if (props.modelValue !== undefined) { if (props.modelValue !== "pending") {
initFileList() initFileList()
if (props.disabled == false) {
disabled.value = false
}
inited.value = true inited.value = true
return return
} }