Skip to content

Commit 1babc3e

Browse files
committed
expose path and fullPath on handlers
1 parent 9431c59 commit 1babc3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,11 @@ class Router {
267267
*/
268268

269269
_addRoute (path, handler, segments) {
270-
handler.path = path
271270
guardComponent(path, handler)
271+
handler.path = path
272+
handler.fullPath = (segments.reduce(function (path, segment) {
273+
return path + segment.path
274+
}, '') + path).replace('//', '/')
272275
segments.push({
273276
path: path,
274277
handler: handler

0 commit comments

Comments
 (0)