Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
31
Frontend-Learner/node_modules/nuxt/dist/head/runtime/plugins/unhead.js
generated
vendored
Normal file
31
Frontend-Learner/node_modules/nuxt/dist/head/runtime/plugins/unhead.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { createHead as createClientHead, renderDOMHead } from "@unhead/vue/client";
|
||||
import { defineNuxtPlugin } from "#app/nuxt";
|
||||
import unheadOptions from "#build/unhead-options.mjs";
|
||||
export default defineNuxtPlugin({
|
||||
name: "nuxt:head",
|
||||
enforce: "pre",
|
||||
setup(nuxtApp) {
|
||||
const head = import.meta.server ? nuxtApp.ssrContext.head : createClientHead(unheadOptions);
|
||||
nuxtApp.vueApp.use(head);
|
||||
if (import.meta.client) {
|
||||
let pauseDOMUpdates = true;
|
||||
const syncHead = async () => {
|
||||
pauseDOMUpdates = false;
|
||||
await renderDOMHead(head);
|
||||
};
|
||||
head.hooks.hook("dom:beforeRender", (context) => {
|
||||
context.shouldRender = !pauseDOMUpdates;
|
||||
});
|
||||
nuxtApp.hooks.hook("page:start", () => {
|
||||
pauseDOMUpdates = true;
|
||||
});
|
||||
nuxtApp.hooks.hook("page:finish", () => {
|
||||
if (!nuxtApp.isHydrating) {
|
||||
syncHead();
|
||||
}
|
||||
});
|
||||
nuxtApp.hooks.hook("app:error", syncHead);
|
||||
nuxtApp.hooks.hook("app:suspense:resolve", syncHead);
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue