c***@126.com
c***@126.com
  • 发布:2022-06-08 12:58
  • 更新:2022-07-08 20:50
  • 阅读:360

【报Bug】3.4.14升级后,@load拿到的图片宽高不正常。

分类:uniCloud

产品分类: uniCloud/App

操作步骤:
<template> <image :class="name" :src="getSrc" @load="picloaded" :style="'width:'+style.width+'rpx;height:'+style.height+'rpx;opacity:'+style.opcity"></image> </template> <script> import envConfig from "../config/index"; import pics from "../config/pics.js"; export default { data() { return { style:{ width:"", height:"", opcity:0, } }; }, props: { name: { type: String, }, }, computed: { getSrc() { var url=envConfig.cdn + "images/" + this.name.replace(/\_/g, "/") + ".png";; return url; }, }, created() {}, mounted() { // console.log(envConfig.cdn); }, methods: { picloaded:function(e){ // console.log(e); this.style.width=e.detail.width; this.style.height=e.detail.height; this.style.opcity=1; } }, }; </script> <style></style>

预期结果:

我自己封装了一个图片组件,当图片加载后自动给他高宽。之前是正常的

实际结果:

更新后,@load拿到的图片高宽尺寸是错的。

bug描述:

Hbuilder升级到最新版本3.4.14后,给<image>组件添加stlyes的属性都不生效了。只能回滚到上一版,希望修复

2022-06-08 12:58 负责人:无 分享
已邀请:
小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

你说的是编译到h5么?

  • 小枫叶

    我这边试了下,没有这样的问题 请把你的demo工程发一下


    2022-06-08 19:17

  • c***@126.com (作者)

    回复 小枫叶: 我仔细看过了,stlye是有用的,而是@load拿到的高宽是错的。表现和之前版本的不同


    2022-06-09 00:09

DCloud_UNI_GSQ

DCloud_UNI_GSQ

更新到 3.4.15 试试

  • c***@126.com (作者)

    3.4.15试了还是不行,我依然退到3.4.7了


    2022-06-17 14:46

DCloud_UNI_GSQ

DCloud_UNI_GSQ

问题确认,已加分,即将修复。

  • c***@126.com (作者)

    好的,我更了3.4.18.已经修好了,感谢


    2022-07-02 19:50

DCloud_UNI_Anne

DCloud_UNI_Anne

HBuilderX 3.4.18 已修复

要回复问题请先登录注册