【修复】修复自建组件的问题
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
:isMultiple="isMultiple"
|
||||
:showUploadList="isMultiple"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
v-on="childListeners"
|
||||
@change="handleChange"
|
||||
@preview="handlePreview"
|
||||
:class="!isMultiple?'imgupload':''">
|
||||
@@ -84,6 +84,17 @@
|
||||
}
|
||||
//update-end-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性,用于判断上传数量
|
||||
},
|
||||
computed: {
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
const vm = this;
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
)
|
||||
delete result.change;
|
||||
return result;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
value: {
|
||||
handler(val,oldValue) {
|
||||
@@ -194,7 +205,7 @@
|
||||
if(arr.length>0){
|
||||
path = arr.join(",")
|
||||
}
|
||||
this.$emit('image-change', path);
|
||||
this.$emit('change', path);
|
||||
},
|
||||
handleDelete(file){
|
||||
//如有需要新增 删除逻辑
|
||||
@@ -209,7 +220,7 @@
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'image-change'
|
||||
event: 'change'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user