This commit is contained in:
李志鹏
2026-04-17 10:17:03 +08:00
parent 91cfcd7e40
commit ce6522ef90
3 changed files with 12 additions and 7 deletions

View File

@@ -44,7 +44,7 @@
<a-input <a-input
placeholder="https://" placeholder="https://"
v-for="(v, i) in formData.links" v-for="(v, i) in formData.links"
:key="i" :key="v + i"
v-model:value="formData.links[i]" v-model:value="formData.links[i]"
:readonly="!isEdit" :readonly="!isEdit"
> >
@@ -129,10 +129,8 @@
edit() edit()
} }
const submit = async () => { const submit = async () => {
const valid = await formRef.value.validate() await formRef.value.validate()
if (!valid) return Promise.reject(false) return JSON.parse(JSON.stringify(formData))
console.log(valid)
return valid
} }
defineExpose({ defineExpose({
submit submit

View File

@@ -96,7 +96,8 @@
const onSubmit = () => { const onSubmit = () => {
brandInfoRef.value brandInfoRef.value
.submit() .submit()
.then(() => { .then((res) => {
console.log(res)
isEdit.value = false isEdit.value = false
}) })
.catch(() => {}) .catch(() => {})

View File

@@ -66,7 +66,9 @@
</div> </div>
</div> </div>
<div class="placeholder" ref="placeholderRef" v-show="!loading"></div> <div class="placeholder" ref="placeholderRef" v-show="!loading"></div>
<div class="footer" v-if="!finish"><a-spin :delay="0.5" v-show="loading" /></div> <div class="footer" :class="{ null: list.length === 0 }" v-if="!finish">
<a-spin :delay="0.5" v-show="loading" />
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -99,6 +101,7 @@
const nameOrId = ref("") const nameOrId = ref("")
const list = ref([]) const list = ref([])
const getList = (isReload = false) => { const getList = (isReload = false) => {
if (loading.value) return
loading.value = true loading.value = true
if (isReload) { if (isReload) {
list.value = [] list.value = []
@@ -350,6 +353,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&.null {
height: 30rem;
}
} }
> .placeholder { > .placeholder {
width: 100%; width: 100%;