人人畅享
人人畅享
  • 发布:2020-08-01 21:33
  • 更新:2021-09-07 10:10
  • 阅读:711

父组件往子组件传值:微信小程序可以正常显示、安卓app确实undefined

分类:uni-app

子组件内容如下

<template>  
  <view class="struc_ul">  
        1{{openId}}2  
  </view>  

</template>  

<script>  
export default {  

  props: {  
        openId: {  
          type: String,  
          default: '1'  
        },  
    strucType: {  
      type: String,  
      default: '2'  
    }  
  },  
created() {  
        _self = this;  
        console.log("props.openId" + _self.openId);  
  };  
</script>  
<style scoped>  
</style>

父组件中调用如下:  
<struc-tree ref="strucTreeCoz" :openId.sync='openId' :strucType.sync='strucType'></struc-tree>  

最后渲染出来的内容1{{openId}}2、openId是undefined
在openId子组件created函数中是可以正常打印出传递的值,请大家指教,多谢!

2020-08-01 21:33 负责人:无 分享
已邀请:
人人畅享

人人畅享 (作者)

无人回答

1***@qq.com

1***@qq.com - 普通开发者

卧槽,我也遇到这样的bug,在js里面有值但html中undefined。。。

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