Closed haizhilin2013 closed 7 years ago
当把root设置为"/"时,如果路由是"/product/lists.html", 点击了链接,再刷新的时候, 就会进不到这个路由里(不能输出'product...')
这个问题要怎么修复呢? 用的mmRouter版本是最新版的v0.9.3
avalon.history.start({ root: "/", // 设置成了/ 就会有问题 html5: true }) // 添加了一个路由 avalon.router.add("/product/lists.html", function (a) { console.log('product...'); }) // 如果是路由包含问号的情况下, 也不能正确获取, 转义\?也不行 avalon.router.add("/product/detail.html?id=123", function (a) { console.log('test'); }); // 原因是在mmHistory里, 被这个方法过滤了, 输出的path是: /product getPath: function () { var path = location.pathname var path = path.split(this.options.root)[1] if (path.charAt(0) !== '/') { path = '/' + path } return path }
更新,这个有人修复了
当把root设置为"/"时,如果路由是"/product/lists.html", 点击了链接,再刷新的时候, 就会进不到这个路由里(不能输出'product...')
这个问题要怎么修复呢? 用的mmRouter版本是最新版的v0.9.3