// 数据更新 -> 图表重新渲染 -> 默认高亮
// 重新渲染需要时间
this.$nextTick(() => {
const chart = this.$refs["chartContainer"].chart;
if (chart) {
chart.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: 0
});
}
});
这里最主要的是要加this.$nextTick,因为加载数据需要时间,图标重新渲染需要时间。
原文:https://www.cnblogs.com/sinceForever/p/12146222.html