mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-02-05 14:20:08 +08:00
Allow loading pure script
This commit is contained in:
parent
d8295dff33
commit
33d431606d
@ -13,20 +13,24 @@ if (process.env.NODE_ENV === 'development') {
|
||||
setTimeout(langs.find(({ lang }) => lang === blessing.locale).load, 0)
|
||||
}
|
||||
|
||||
(() => {
|
||||
{
|
||||
const route = routes.find(
|
||||
// eslint-disable-next-line no-shadow
|
||||
route => (new RegExp(`^${route.path}$`, 'i')).test(blessing.route)
|
||||
)
|
||||
if (route) {
|
||||
Vue.prototype.$route = (new RegExp(`^${route.path}$`, 'i')).exec(blessing.route)
|
||||
// eslint-disable-next-line no-new
|
||||
new Vue({
|
||||
el: route.el,
|
||||
mounted() {
|
||||
setTimeout(() => emitter.emit('mounted', { el: route.el }), 100)
|
||||
},
|
||||
render: h => h(route.component),
|
||||
})
|
||||
if (route.component) {
|
||||
Vue.prototype.$route = (new RegExp(`^${route.path}$`, 'i')).exec(blessing.route)
|
||||
// eslint-disable-next-line no-new
|
||||
new Vue({
|
||||
el: route.el,
|
||||
mounted() {
|
||||
setTimeout(() => emitter.emit('mounted', { el: route.el }), 100)
|
||||
},
|
||||
render: h => h(route.component),
|
||||
})
|
||||
} else if (route.script) {
|
||||
route.script()
|
||||
}
|
||||
}
|
||||
})()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user