我正在尝试为我在 react 中的应用程序实现 hopscotch tour。hopscotch 中的多页游览无法正常工作。文档说它可以与 sessionStorage 和 cookie 一起使用,这可能是一个问题。如果这些是页面中的步骤1 导航前
var tour = {
id: "hello-hopscotch",
steps: [
{
title: "Header Page",
content: "We're going to the next page now...",
target: "#header",
placement: "bottom",
multipage: true,
onNext: function() {
window.location = "/#/configuration"
}
},
{
title: "My content",
content: "Here is where I put my content.",
target: document.querySelector("#content p"),
placement: "bottom"
}
]
};
这在第二页
if (hopscotch.getState() === "hello-hopscotch:1") {
hopscotch.startTour(
id: "hello-hopscotch",
steps: [
{
title: "Header Page",
content: "We're going to the next page now...",
target: "#header",
placement: "bottom",
multipage: true,
onNext: function() {
window.location = "/#/configuration"
}
},
{
title: "Configuration page",
content: "Here is where I put my content.",
target: "#configuration",
placement: "bottom"
}
]
);
}
使游览从一个页面导航到另一个页面的第一页和第二页中的步骤究竟应该是什么。
这不起作用,导航到第二页后它仍然重复相同的步骤,有时它不显示任何步骤。我可以在我的反应应用程序中使用 hopscotch 详细实现多页巡回演出吗?