Commit d14e396f authored by Jenny's avatar Jenny

feat: 远程图片

parent 671f2342
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
class="remoteImage" class="remoteImage"
:src="imageUrl" :src="imageUrl"
width="100%" width="100%"
:height="imageHeight" height="100%"
mode="aspectFit"
></u-image> ></u-image>
</view> </view>
</template> </template>
...@@ -18,24 +19,15 @@ ...@@ -18,24 +19,15 @@
mixins: [echartElementData], mixins: [echartElementData],
data() { data() {
return { return {
imageUrl:"", imageUrl:""
windowWidth: 0, //屏幕宽度
imageHeight:0 //图片高度
}; };
}, },
methods:{ methods:{
initChart() { initChart() {
uni.getSystemInfo({
success: res=> {
this.windowWidth = res.windowWidth;
this.imageHeight = (this.windowWidth*this.elementInfo.height)/this.elementInfo.width;
}
});
this.$nextTick(() => { this.$nextTick(() => {
this.imageUrl = this.elementData.dataList.imageUrl this.imageUrl = this.elementData.dataList.imageUrl
}) })
}, }
} }
} }
</script> </script>
...@@ -44,11 +36,12 @@ ...@@ -44,11 +36,12 @@
.remoteView { .remoteView {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
.remoteImage { .remoteImage {
object-fit: contain; width: 100%;
} height: 100%;
}
</style> </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