{"action":"opened","issue":{"url":"https://api.github.com/repos/vuejs/vue-router/issues/908","repository_url":"https://api.github.com/repos/vuejs/vue-router","labels_url":"https://api.github.com/repos/vuejs/vue-router/issues/908/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-router/issues/908/comments","events_url":"https://api.github.com/repos/vuejs/vue-router/issues/908/events","html_url":"https://github.com/vuejs/vue-router/issues/908","id":189610373,"number":908,"title":"Support for multiple nested empty subroute paths","user":{"login":"decademoon","id":5779055,"avatar_url":"https://avatars.githubusercontent.com/u/5779055?v=3","gravatar_id":"","url":"https://api.github.com/users/decademoon","html_url":"https://github.com/decademoon","followers_url":"https://api.github.com/users/decademoon/followers","following_url":"https://api.github.com/users/decademoon/following{/other_user}","gists_url":"https://api.github.com/users/decademoon/gists{/gist_id}","starred_url":"https://api.github.com/users/decademoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decademoon/subscriptions","organizations_url":"https://api.github.com/users/decademoon/orgs","repos_url":"https://api.github.com/users/decademoon/repos","events_url":"https://api.github.com/users/decademoon/events{/privacy}","received_events_url":"https://api.github.com/users/decademoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-16T06:58:08Z","updated_at":"2016-11-16T06:58:08Z","closed_at":null,"body":"Vue version: 2.0.6\r\nVue-router version: 2.0.2\r\nReproduction link: http://jsfiddle.net/4wogLvcd/\r\n\r\nGiven the following routes:\r\n\r\n``` js\r\nconst A = { template: '<div>A <router-view/></div>' };\r\nconst B = { template: '<div>B <router-view/></div>' };\r\nconst C = { template: '<div>C</div>' };\r\n\r\n{\r\n  path: '/a',\r\n  name: 'a',\r\n  component: A,\r\n  children: [\r\n    {\r\n      path: '',\r\n      name: 'b',\r\n      component: B,\r\n      children: [\r\n        {\r\n          path: '',\r\n          name: 'c',\r\n          component: C,\r\n        },\r\n      ],\r\n    },\r\n  ],\r\n}\r\n```\r\n\r\nWhen matching against the path `/a`, vue-router will return the `b` route instead of `c`. vue-router version 1 correctly returned route `c` in this case.\r\n\r\nAlso, vue-router seems to associate route `b` with path `/a/`, why the trailing slash? Shouldn't path `/a` always be resolved to route `c` (regardless of any trailing slash)?\r\n\r\nI managed to get it working the way I want by changing in the `addRouteRecord` function\r\n\r\n``` js\r\npathMap[record.path] = record\r\n```\r\n\r\nto\r\n\r\n``` js\r\nif (!pathMap[record.path]) pathMap[record.path] = record\r\n```\r\n\r\nthat way only the deepest route will be associated with the path, but I don't know if this breaks anything else. What do you think?"}}
{"actor":{"display_login":"decademoon"}}