提交 1903fdc6 编写于 作者: fxy060608's avatar fxy060608

Merge branch 'v3' of https://github.com/dcloudio/uni-app into v3

......@@ -97,7 +97,8 @@ export default {
}
},
watch: {
src (newValue, oldValue) {
src (newValue, oldValue) {
this._setContentImage()
this._loadImage()
},
mode (newValue, oldValue) {
......@@ -111,7 +112,11 @@ export default {
}
},
mounted () {
this.availHeight = this.$el.style.height || ''
this.availHeight = this.$el.style.height || ''
this._setContentImage()
if (!this.realImagePath) {
return
}
this._loadImage()
},
methods: {
......@@ -131,10 +136,11 @@ export default {
this.$el.style.height = height + 'px'
this.sizeFixed = true
}
},
_setContentImage () {
this.$refs.content.style.backgroundImage = this.src ? `url(${this.realImagePath})` : 'none'
},
_loadImage () {
this.$refs.content.style.backgroundImage = this.src ? `url(${this.realImagePath})` : 'none'
const _self = this
const img = new Image()
img.onload = function ($event) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册