【发布时间】:2018-02-11 14:24:59
【问题描述】:
我正在尝试为我在 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"
}
]
);
}
第一页和第二页中的步骤究竟应该是什么,才能使导览从一个页面导航到另一个页面。
这不起作用,导航到第二页后它仍然重复相同的步骤,有时它不显示任何步骤。 我可以在我的 react 应用程序中使用 hopscotch 详细实现多页巡回吗?
【问题讨论】:
标签: reactjs navigation multipage hopscotch