一、vant 中拿不到ref的值
使用第三方组件vant 中 使用tab切换this.$ref拿不到值
解决方法
:lazy-render=‘false’
就好了!!!!!!!!!!!!!!!!!11
二 实时更新切换tab时的数据 (三个echarts 切换的时候第一个显示正常第二个第三个的默认宽高,很窄)
当tab切换的时候需要判断当前的name 是那个 当他指定跳转到其中的哪一个的时候需要重绘.resize()
ps:
注意如果获取不到需多次查看是否获取到init()括号里的
if (tab === 'first') {
if (!this.scoreNoDate) {
this.$nextTick(() => {
echarts.init(document.getElementById('scoreEchart')).resize();
})
}
} else if (tab === 'second') {
if (!this.weiNoDate) {
this.$nextTick(() => {
echarts.init(document.getElementById('mainchart')).resize();
})
}
} else if (tab === 'third') {
if (!this.foodNoDate) {
this.$nextTick(() => {
echarts.init(document.getElementById('foodchart')).resize();
})
}
}