Skip to content

Commit

Permalink
fix(Loading): initialize the instance with the parent app #15245
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Jan 11, 2023
1 parent 93e7bb5 commit e644cc8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ui/src/plugins/Loading.js
@@ -1,7 +1,8 @@
import { h, createApp, Transition, onMounted } from 'vue'
import { h, Transition, onMounted } from 'vue'

import QSpinner from '../components/spinner/QSpinner.js'

import { createChildApp } from '../install-quasar.js'
import defineReactivePlugin from '../utils/private/define-reactive-plugin.js'
import { createGlobalNode, removeGlobalNode } from '../utils/private/global-nodes.js'
import preventScroll from '../utils/prevent-scroll.js'
Expand Down Expand Up @@ -68,7 +69,7 @@ const Plugin = defineReactivePlugin({

const el = createGlobalNode('q-loading')

app = createApp({
app = createChildApp({
name: 'QLoading',

setup () {
Expand Down Expand Up @@ -130,7 +131,7 @@ const Plugin = defineReactivePlugin({
onAfterLeave
}, getContent)
}
})
}, Plugin.__parentApp)

vm = app.mount(el)
}, props.delay)
Expand Down Expand Up @@ -189,11 +190,15 @@ const Plugin = defineReactivePlugin({
}
},

install ({ $q }) {
install ({ $q, parentApp }) {
$q.loading = this

if (__QUASAR_SSR_SERVER__ !== true && $q.config.loading !== void 0) {
this.setDefaults($q.config.loading)
if (__QUASAR_SSR_SERVER__ !== true) {
Plugin.__parentApp = parentApp

if ($q.config.loading !== void 0) {
this.setDefaults($q.config.loading)
}
}
}
})
Expand Down

0 comments on commit e644cc8

Please sign in to comment.