IE下vue父传子组件值时候变为空,但是chrome又是有值的

组件:

<MeasureBar ref="bars0" chart-id="0" :measure="weight"></MeasureBar>

传值:

this.weight = {
     id:'0',
     measurement:'体重',unit:'(kg)',
     standard_from:res.low_up_limit.weight[0],
     standard_to:res.low_up_limit.weight[1],
     value:res.body.weight,
     diff:res.body_diff.weight
}

chrome下有可以打印,ie下父组件可以打印出

子组件内:

props:['measure'],

子组件方法:

drawBar() {
    let barWidth = 231;
    console.log(JSON.stringify(this.measure)) 
    ...
}

这里ie下变成空对象父组

父件内调用此方法:

this.$refs.bars0.drawBar(); 
阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题