Website Structure

This commit is contained in:
supalerk-ar66 2026-01-13 10:46:40 +07:00
parent 62812f2090
commit 71f0676a62
22365 changed files with 4265753 additions and 791 deletions

View file

@ -0,0 +1,28 @@
import { nextTick } from "vue";
import { defineNuxtPlugin } from "../nuxt.js";
import { onNuxtReady } from "../composables/ready.js";
import { useError } from "../composables/error.js";
import layouts from "#build/layouts";
export default defineNuxtPlugin({
name: "nuxt:checkIfLayoutUsed",
setup(nuxtApp) {
const error = useError();
function checkIfLayoutUsed() {
if (!error.value && !nuxtApp._isNuxtLayoutUsed && Object.keys(layouts).length > 0) {
console.warn("[nuxt] Your project has layouts but the `<NuxtLayout />` component has not been used.");
}
}
if (import.meta.server) {
nuxtApp.hook("app:rendered", ({ renderResult }) => {
if (renderResult?.html) {
nextTick(checkIfLayoutUsed);
}
});
} else {
onNuxtReady(checkIfLayoutUsed);
}
},
env: {
islands: false
}
});