组件:
<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();