fix(server/plugins): use additional hooks to determine page readiness
This commit is contained in:
parent
989fefd6e7
commit
bd098c987b
@ -3,9 +3,17 @@ export default defineNuxtPlugin({
|
|||||||
setup(nuxt) {
|
setup(nuxt) {
|
||||||
console.log("setup start");
|
console.log("setup start");
|
||||||
let loaded: Ref<boolean> = ref(false);
|
let loaded: Ref<boolean> = ref(false);
|
||||||
nuxt.hook("page:finish", (comp) => {
|
nuxt.hook("app:beforeMount", (app) => {
|
||||||
|
loaded.value = false;
|
||||||
|
});
|
||||||
|
nuxt.hook("page:start", (comp) => {
|
||||||
|
loaded.value = false;
|
||||||
|
// comp.$nuxt.$loaded = loaded;
|
||||||
|
});
|
||||||
|
nuxt.hook("app:mounted", (comp) => {
|
||||||
console.log("setup end");
|
console.log("setup end");
|
||||||
loaded.value = true;
|
loaded.value;
|
||||||
|
comp.$nuxt.$loaded.value = loaded.value = true;
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
provide: {
|
provide: {
|
||||||
|
Loading…
Reference in New Issue
Block a user