feat: base xtUpload初始化优化
This commit is contained in:
parent
0ba1160edc
commit
95c52117cc
|
|
@ -24,7 +24,7 @@ const emit = defineEmits(["update:modelValue", "update:obj"]);
|
|||
|
||||
const props = defineProps({
|
||||
xtype: { type: String, default: "path" }, // path 或 id
|
||||
modelValue: { type: [Array, String], default: undefined },
|
||||
modelValue: { type: [Array, String], default: "pending" },
|
||||
obj: { type: Object, default: () => ({}) },
|
||||
accept: { type: String, default: '' },
|
||||
countMax: { type: Number, default: 1 },
|
||||
|
|
@ -44,18 +44,14 @@ const action = `${config.baseUrl}/file/`
|
|||
|
||||
const inited = ref(false)
|
||||
onMounted(() => {
|
||||
disabled.value = true
|
||||
checkPropsUntilReady()
|
||||
})
|
||||
|
||||
const checkPropsUntilReady = () => {
|
||||
if (inited.value) return
|
||||
|
||||
if (props.modelValue !== undefined) {
|
||||
if (props.modelValue !== "pending") {
|
||||
initFileList()
|
||||
if (props.disabled == false) {
|
||||
disabled.value = false
|
||||
}
|
||||
inited.value = true
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue