BUG 140
This commit is contained in:
@@ -40,6 +40,10 @@ import AiImage from '../AiImage/AiImage'
|
||||
export default {
|
||||
name: 'AiUploader',
|
||||
components: {AiImage},
|
||||
model:{
|
||||
prop: 'def',
|
||||
event: 'input'
|
||||
},
|
||||
props: {
|
||||
limit: {default: 1}, //数量
|
||||
placeholder: {default: '添加图片'}, // 文字提示
|
||||
@@ -86,7 +90,7 @@ export default {
|
||||
methods: {
|
||||
remove(index) {
|
||||
this.fileList.splice(index, 1)
|
||||
this.$emit('list', this.fileList)
|
||||
this.$emit('input', this.fileList)
|
||||
},
|
||||
upload(wait) {
|
||||
let count = this.limit - (this.fileList?.length || 0)
|
||||
@@ -145,8 +149,6 @@ export default {
|
||||
this.$u.toast('上传成功!')
|
||||
if (this.action.endsWith('/file/add')) {
|
||||
this.fileList.push({url: res.data?.[0]?.split(";")?.[0], id: res.data?.[0]?.split(";")?.[1]})
|
||||
this.$emit('input', [...this.fileList])
|
||||
this.$emit('change', [...this.fileList])
|
||||
} else if (this.action == '/admin/file/add2') {
|
||||
let info = res.data
|
||||
this.$emit('update:fileId', info?.id)
|
||||
@@ -155,7 +157,7 @@ export default {
|
||||
this.fileList.push({url: res.data?.split(";")?.[0], id: res.data?.split(";")?.[1]})
|
||||
}
|
||||
this.$emit("update:def", this.fileList)
|
||||
this.$emit("list", this.fileList)
|
||||
this.$emit("input", this.fileList)
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user