Commit d14e396f authored by Jenny's avatar Jenny

feat: 远程图片

parent 671f2342
<template>
<view class="remoteView">
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<u-image
class="remoteImage"
:src="imageUrl"
width="100%"
:height="imageHeight"
class="remoteImage"
:src="imageUrl"
width="100%"
height="100%"
mode="aspectFit"
></u-image>
</view>
</template>
......@@ -18,37 +19,29 @@
mixins: [echartElementData],
data() {
return {
imageUrl:"",
windowWidth: 0, //屏幕宽度
imageHeight:0 //图片高度
imageUrl:""
};
},
methods:{
initChart() {
uni.getSystemInfo({
success: res=> {
this.windowWidth = res.windowWidth;
this.imageHeight = (this.windowWidth*this.elementInfo.height)/this.elementInfo.width;
}
});
this.$nextTick(() => {
this.imageUrl = this.elementData.dataList.imageUrl
})
},
}
}
}
</script>
<style lang="scss" scoped>
.remoteView {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.remoteImage {
object-fit: contain;
}
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: hidden;
}
.remoteImage {
width: 100%;
height: 100%;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment