我的 Bootstrap 之旅正常工作,但后来我做了一些工作,但无法弄清楚我在哪里搞砸了。我无法发布 git repo,因为它是私有的。所以我的错误是代码是在您第一次进入页面时运行的。我在 Chrome 控制台中遇到的错误是:
bootstrap-tour.min.js:22 Uncaught TypeError: this._options.storage.getItem is not a function
at o._getState (bootstrap-tour.min.js:22)
at o.ended (bootstrap-tour.min.js:22)
at o.init (bootstrap-tour.min.js:22)
at main.js:207
at main.js:212
我登录后初始页面加载的代码
if(location.href == 'https://example.com/dashboard'){
(function(){
var tour = new Tour({
storage : true,
steps: [
{
element: ".tour-step.tour-step-one",
placement: "top",
title: "Welcome to Phantom AM!",
content: "This tour will guide you through some of the features we'd like to point out.",
},
{
element: ".tour-step.tour-step-two",
placement: "bottom",
title: "Quick Tracker",
content: "These four boxes show a quick look at what you have tracked so far.",
},
{
element: ".tour-step.tour-step-three",
placement: "right",
title: "Add a manufacturer",
content: "Start by adding a manufacturer.",
},
{
element: ".tour-step.tour-step-four",
title: "Title of my step",
content: "Content of my step",
path: "/dashboard/it/manufacturer/new"
}
]
});
// Initialize the tour
tour.init(); **// error line**
// Start the tour
tour.start();
}()); **// error line**
}