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({
|
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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue