[main] fix 'to' instead of 'history.current' route name
This commit is contained in:
parent
c5e6b49fa6
commit
5db05aea5c
|
@ -17,7 +17,7 @@ gs.get.router.beforeEach((to, from, next) => {
|
||||||
|
|
||||||
// {2} Get appropriate page location //
|
// {2} Get appropriate page location //
|
||||||
let auth_folder = (gs.get.auth) ? 'auth' : 'noauth';
|
let auth_folder = (gs.get.auth) ? 'auth' : 'noauth';
|
||||||
let page_file = gs.get.router.history.current.name || gs.get.routes[auth_folder][0].name;
|
let page_file = to.name || gs.get.routes[auth_folder][0].name;
|
||||||
|
|
||||||
// {3} Load page script //
|
// {3} Load page script //
|
||||||
require(`./page/${auth_folder}/${page_file}.js`);
|
require(`./page/${auth_folder}/${page_file}.js`);
|
||||||
|
|
Loading…
Reference in New Issue