白色主题
This commit is contained in:
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
import { SuperComponent, wxComponent } from '../common/src/index';
|
||||
import ImageProps from './props';
|
||||
import config from '../common/config';
|
||||
import { addUnit } from '../common/utils';
|
||||
import { addUnit, getRect } from '../common/utils';
|
||||
const { prefix } = config;
|
||||
const name = `${prefix}-image`;
|
||||
let Image = class Image extends SuperComponent {
|
||||
@@ -59,15 +59,11 @@ let Image = class Image extends SuperComponent {
|
||||
(versionArray[0] === 2 && versionArray[1] === 10 && versionArray[2] < 3);
|
||||
if (mode === 'heightFix' && isInCompatible) {
|
||||
const { height: picHeight, width: picWidth } = e.detail;
|
||||
const query = this.createSelectorQuery();
|
||||
query
|
||||
.select('#image')
|
||||
.boundingClientRect((res) => {
|
||||
const { height } = res;
|
||||
getRect(this, '#image').then((rect) => {
|
||||
const { height } = rect;
|
||||
const resultWidth = ((height / picHeight) * picWidth).toFixed(2);
|
||||
this.setData({ innerStyle: `height: ${addUnit(height)}; width: ${resultWidth}px;` });
|
||||
})
|
||||
.exec();
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
isLoading: false,
|
||||
|
||||
Reference in New Issue
Block a user