顾北辰
顾北辰
  • 发布:2020-09-29 11:38
  • 更新:2020-09-29 11:38
  • 阅读:558

【报Bug】- 计算属性方式加载图片 小程序加载多次 各种报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.13.6 (17G14019)

HBuilderX类型: 正式

HBuilderX版本号: 2.8.13

手机系统: 全部

手机厂商: 华为

页面类型: vue

打包方式: 离线

项目创建方式: HBuilderX

测试过的手机:

iPhone XS Max

示例代码:
<template>  
  <view class="content">  
    <image class="logo" :src="root + '/logo.png'"></image>  
    <view>  
      <text class="title">{{ title }}</text>  
    </view>  
  </view>  
</template>  

<script>  
export default {  
  data() {  
    return {  
      title: 'Hello'  
    }  
  },  
  onLoad() {  
  },  
  computed: {  
    root() {  
      return '/static';  
    }  
  },  
}  
</script>  

<style>  
.content {  
  display: flex;  
  flex-direction: column;  
  align-items: center;  
  justify-content: center;  
}  

.logo {  
  height: 200 rpx;  
  width: 200 rpx;  
  margin: 200 rpx auto 50 rpx auto;  
}  

.text-area {  
  display: flex;  
  justify-content: center;  
}  

.title {  
  font-size: 36 rpx;  
  color: #8f8f94;  
}  
</style>  

操作步骤:

直接运行编译小程序即可复现

预期结果:

和h5一样的方式运行

实际结果:

h5 正常加载
小程序 多次加载还报错

bug描述:

用计算属性的方式写小程序 为什么 各种报错 图片还加载了4次 有点懵 ?!

2020-09-29 11:38 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复