2023-10-11 16:54:32 -04:00
|
|
|
export default defineNuxtPlugin({
|
|
|
|
name: "set finish",
|
|
|
|
setup(nuxt) {
|
|
|
|
console.log("setup start");
|
|
|
|
let loaded: Ref<boolean> = ref(false);
|
2023-12-09 17:16:58 -05:00
|
|
|
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) => {
|
2023-10-11 16:54:32 -04:00
|
|
|
console.log("setup end");
|
2023-12-09 17:16:58 -05:00
|
|
|
loaded.value;
|
|
|
|
comp.$nuxt.$loaded.value = loaded.value = true;
|
2023-10-11 16:54:32 -04:00
|
|
|
});
|
|
|
|
return {
|
|
|
|
provide: {
|
|
|
|
loaded,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|