神的尾巴
神的尾巴
  • 发布:2020-08-23 05:00
  • 更新:2020-08-24 17:23
  • 阅读:768

【报Bug】H5下使用renderjs模块和当前页面/组件会命名冲突,且可以获取到非观测更新数据

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.6

HBuilderX类型: Alpha

HBuilderX版本号: 2.8.8

浏览器平台: Chrome

浏览器版本: 84.0.4147.135

项目创建方式: HBuilderX

操作步骤:
<!-- 复现 DEMO -->  
<template>  
  <view :prop="options" :change:prop="testRenderJs.optionsChange" class="content">  
  </view>  
</template>  
<script module="testRenderJs" lang="renderjs">  
export default {  
  mounted() {  
    // h5 输出 page init  
    this.init()  
    // h5 能访问 this.other  
    console.log(this.other)  
  },  
  methods: {  
    init() {  
      console.log('renderjs init')  
    },  
    optionsChange() {  
      // ...  
    }  
  }  
}  
</script>  
<script>  
export default {  
  data() {  
    return {  
      options: {  
        enable: false,  
      },  
      other: {  
        test: 'test'  
      }  
    }  
  },  
  methods: {  
    init() {  
      console.log('page init')  
    }  
  }  
}  
</script>

预期结果:

输出 render init
无法获取 this.other

实际结果:

输出 page init
能获取 this.other

bug描述:

目前在 h5 使用时,能够获取到直接获取到非观测更新数据,并且会命名冲突,在APP端(IOS / Android)没有此问题。

2020-08-23 05:00 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

谢谢提醒,已加分
因为 H5 端不像 App 那样逻辑层和 view 层运行在不同的 js 环境,后续会在文档进行说明。

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