You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that when the router got the url config,it tries to
// redirect /foo to /foo/
router.beforeEach((to, from, next) => {
if (!/(\/|\.html)$/.test(to.path)) {
next(Object.assign({}, to, {
path: to.path + '/'
}))
} else {
next()
}
})
but the next function had been invoked again and again , and the route.path was still the '/config' rather than '/config/'.
And I uninstall the vuepress@0.14.1 and install the version 0.8.4, and the problem does not exist.
I compared them. The main difference came from the statement, in History.prototype.transitionTo.
var route = this.router.match(location, this.current);
when the version of vuepress is 0.14.1, the path prop in the return value of the match method, is /config, while it's /config/ in 0.8.4. But before the statement is executed, the value of the path prop in the first parameter location,is /config/.
And another diffrence is that the route object has name prop in the version 0.14.1, while it does not in version 0.8.4
I had not read the source code of vue-router and vuepress. But I guess there is something wrong with the name prop of the route object. And I noticed that a route config is created in the dir temp/routes when you run the dev command.
Your OS: macOS Sierra 10.12.6
Node.js version: 9.8.0
Browser version: Chrome 68.0.3440.84
Is this a global or local install? local
Which package manager did you use for the install? yarn
The text was updated successfully, but these errors were encountered:
Bug report
Version
0.14.1
Steps to reproduce
http://localhost:8080/config/
,OK,it workshttp://localhost:8080/config
What is expected?
The page shoule be redirect to
http://localhost:8080/config/
What is actually happening?
The page does not show anything.
My Pull Request Here
It's my PR here
Other relevant information
I used the source panel and debug step by step.
It seems that when the router got the url
config
,it tries tobut the next function had been invoked again and again , and the route.path was still the '/config' rather than '/config/'.
And I uninstall the
vuepress
@0.14.1 and install the version 0.8.4, and the problem does not exist.I compared them. The main difference came from the statement, in
History.prototype.transitionTo
.when the version of vuepress is 0.14.1, the path prop in the return value of the match method, is
/config
, while it's/config/
in 0.8.4. But before the statement is executed, the value of the path prop in the first parameterlocation
,is/config/
.And another diffrence is that the route object has name prop in the version 0.14.1, while it does not in version 0.8.4
I had not read the source code of
vue-router
andvuepress
. But I guess there is something wrong with the name prop of the route object. And I noticed that a route config is created in the dirtemp/routes
when you run thedev
command.The text was updated successfully, but these errors were encountered: