From c45690dfbf7ecbbe5d9848239f7beec3132e6fd1 Mon Sep 17 00:00:00 2001 From: Matteo Gabriele Date: Wed, 15 Nov 2017 23:08:59 +0100 Subject: [PATCH] fix(page): cannot read property 'options' of null checks if the router instance is defined in the plugin configuration, otherwise is not used to prepend the path with the base url closes #72 --- src/lib/page.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/page.js b/src/lib/page.js index a3e0005..4d8886a 100644 --- a/src/lib/page.js +++ b/src/lib/page.js @@ -32,10 +32,11 @@ export default function page (...args) { } = config const queryString = getQueryString(route.query) - const needsBase = prependBase && router.options.base + const base = router && router.options.base + const needsBase = prependBase && base let path = route.path + (transformQueryString ? queryString : '') - path = needsBase ? getBasePath(router.options.base, path) : path + path = needsBase ? getBasePath(base, path) : path set('page', path)