This commit is contained in:
梁灏 2019-03-04 17:17:21 +08:00
parent 4c534a7739
commit 1d5d6ef609
2 changed files with 11 additions and 2 deletions

View file

@ -1,6 +1,6 @@
<template>
<span :class="classes">
<img :src="src" v-if="src">
<img :src="src" v-if="src" @error="handleError">
<Icon :type="icon" :custom="customIcon" v-else-if="icon || customIcon"></Icon>
<span ref="children" :class="[prefixCls + '-string']" :style="childrenStyle" v-else><slot></slot></span>
</span>
@ -89,6 +89,9 @@
this.scale = 1;
}
}
},
handleError (e) {
this.$emit('on-error', e);
}
},
mounted () {