mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
refactor client.js createApp using async/await
This commit is contained in:
parent
ae0c88acbf
commit
a58b85a238
@ -356,23 +356,15 @@ function nuxtReady (app) {
|
||||
}
|
||||
|
||||
createApp()
|
||||
.then((__app) => {
|
||||
.then(async (__app) => {
|
||||
app = __app.app
|
||||
router = __app.router
|
||||
<%= (store ? 'store = __app.store' : '') %>
|
||||
return Promise.all(resolveComponents(router))
|
||||
})
|
||||
.then((Components) => {
|
||||
const Components = await Promise.all(resolveComponents(router))
|
||||
const _app = new Vue(app)
|
||||
|
||||
let layout = NUXT.layout || 'default'
|
||||
return _app.loadLayout(layout)
|
||||
.then(() => {
|
||||
_app.setLayout(layout)
|
||||
return { _app, Components }
|
||||
})
|
||||
})
|
||||
.then(({ _app, Components }) => {
|
||||
const layout = NUXT.layout || 'default'
|
||||
await _app.loadLayout(layout)
|
||||
_app.setLayout(layout)
|
||||
const mountApp = () => {
|
||||
_app.$mount('#__nuxt')
|
||||
Vue.nextTick(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user