allow to pass element directly

This commit is contained in:
Pig Fang 2020-02-05 14:56:49 +08:00
parent 93f64b034f
commit 54c4891fd2

View File

@ -26,7 +26,11 @@ function loadModules() {
<Component />
</React.Suspense>
)
ReactDOM.render(<Root />, document.querySelector(route.el))
if (typeof route.el === 'string') {
ReactDOM.render(<Root />, document.querySelector(route.el))
} else {
ReactDOM.render(<Root />, route.el)
}
}
if (route.component) {
Vue.prototype.$route = new RegExp(`^${route.path}$`, 'i').exec(blessing.route)