子组件内容如下
<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函数中是可以正常打印出传递的值,请大家指教,多谢!  
            
            
            
            
2 个回复
人人畅享 (作者)
无人回答
1***@qq.com - 普通开发者
卧槽,我也遇到这样的bug,在js里面有值但html中undefined。。。