在高图中,通过单击数据点,我需要通过在react中传递点值来重定向到另一页。 我正在使用覆盖面/路由器。有什么可以像React / Router Link这样的观点。
plotOptions :{
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
console.log(this);
// want to redirect to other component like Link in Reach/router.
}
}
}
}
}
答案 0 :(得分:0)
您需要访问组件并使用历史对象将新路由推入组件的props.history
:
options: {
series: [{
data: [1, 2, 3],
point: {
events: {
click: function() {
this.props.history.push("/");
}.bind(this)
}
}
}]
}