From 6407d45f663491d4dfc132587ebee0cb3d4fc1c1 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 27 Mar 2020 06:28:46 +0100 Subject: [PATCH] Issue #31 .path not updated correctly if using class style Vue components --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 70a974c..a947043 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,10 @@ export default function install(Vue, {routes}) { Object.keys(routes).map(path => { routes[path].component.__path = path + // this is required to attach the path to vue-class-components. See #31 + if(routes[path].component.options) { + routes[path].component.options.__path = path; + } }) Vue.mixin({