mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Support retrieving route params
This commit is contained in:
parent
85d9677a64
commit
96af04433c
@ -12,10 +12,15 @@ if (process.env.NODE_ENV === 'development') {
|
||||
setTimeout(langs.find(({ lang }) => lang === blessing.locale).load, 0);
|
||||
}
|
||||
|
||||
const route = routes.find(route => route.path === blessing.route);
|
||||
if (route) {
|
||||
new Vue({
|
||||
el: route.el,
|
||||
render: h => h(route.component)
|
||||
});
|
||||
}
|
||||
(() => {
|
||||
const route = routes.find(
|
||||
route => (new RegExp(`^${route.path}$`, 'i')).test(blessing.route)
|
||||
);
|
||||
if (route) {
|
||||
Vue.prototype.$route = (new RegExp(`^${route.path}$`, 'i')).exec(blessing.route);
|
||||
new Vue({
|
||||
el: route.el,
|
||||
render: h => h(route.component)
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
2
resources/assets/src/shims.d.ts
vendored
2
resources/assets/src/shims.d.ts
vendored
@ -23,5 +23,7 @@ declare module 'vue/types/vue' {
|
||||
|
||||
post(url: string, data?: object): { errno?: number, msg?: string }
|
||||
}
|
||||
|
||||
$route: string[]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user