Skip to content

Commit

Permalink
fix(components): 修复快应用 Image 组件问题 (close #4067)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjinjin0731 authored and luckyadam committed Aug 7, 2019
1 parent 080823f commit 6b9a1ef
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/taro-components-qa/src/components/taro-image/index.ux
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,21 @@
}),

onInit () {
this.imageStyle = Object.assign({}, this.customstyle)
let imageStyle = {}
switch (this.model) {
case 'scaleToFill':
this.imageStyle['resize-mode'] = 'contain'
this.imageStyle['object-fit'] = 'fill';
break;
case 'aspectFit':
this.imageStyle['object-fit'] = 'cover';
break;
case 'widthFix':
this.imageStyle['resize-mode'] = 'cover'
case 'aspectFill':
this.imageStyle['object-fit'] = 'scale-down';
break;
default:
this.imageStyle['resize-mode'] = 'contain'
this.imageStyle['object-fit'] = 'fill';
}
this.imageStyle = Object.assign({}, this.customstyle)
},

handleClick () {
Expand Down

0 comments on commit 6b9a1ef

Please sign in to comment.