mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
refactor: make createRouter support async
This commit is contained in:
parent
869fdc2c25
commit
918ce3c15f
@ -44,11 +44,7 @@ const defaultTransition = <%=
|
|||||||
%>
|
%>
|
||||||
|
|
||||||
async function createApp (ssrContext) {
|
async function createApp (ssrContext) {
|
||||||
if (createRouter.constructor.name === 'AsyncFunction') {
|
|
||||||
const router = await createRouter(ssrContext)
|
const router = await createRouter(ssrContext)
|
||||||
} else {
|
|
||||||
const router = createRouter(ssrContext)
|
|
||||||
}
|
|
||||||
|
|
||||||
<% if (store) { %>
|
<% if (store) { %>
|
||||||
const store = createStore(ssrContext)
|
const store = createStore(ssrContext)
|
||||||
|
Loading…
Reference in New Issue
Block a user