Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
56
Frontend-Learner/node_modules/@nuxt/devtools/dist/runtime/plugins/devtools.client.js
generated
vendored
Normal file
56
Frontend-Learner/node_modules/@nuxt/devtools/dist/runtime/plugins/devtools.client.js
generated
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
import { defineNuxtPlugin, useRouter, useState } from "#imports";
|
||||
import { shallowReactive, watchEffect } from "vue";
|
||||
import { setupHooksDebug } from "../shared/hooks.js";
|
||||
export default defineNuxtPlugin((nuxt) => {
|
||||
if (typeof document === "undefined" || typeof window === "undefined")
|
||||
return;
|
||||
try {
|
||||
if (window.__NUXT_DEVTOOLS_DISABLE__ || window.parent?.__NUXT_DEVTOOLS_DISABLE__)
|
||||
return;
|
||||
if (parent && window.self !== parent) {
|
||||
if (parent.__NUXT_DEVTOOLS_VIEW__ || parent.document.querySelector("#nuxt-devtools-container"))
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Nuxt DevTools: Failed to check parent window");
|
||||
console.error(e);
|
||||
}
|
||||
const timeMetric = shallowReactive(window.__NUXT_DEVTOOLS_TIME_METRIC__ || {});
|
||||
Object.defineProperty(window, "__NUXT_DEVTOOLS_TIME_METRIC__", {
|
||||
value: timeMetric,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
timeMetric.pluginInit = Date.now();
|
||||
const clientHooks = setupHooksDebug(nuxt.hooks);
|
||||
const router = useRouter();
|
||||
nuxt.hook("app:mounted", () => {
|
||||
timeMetric.appLoad = Date.now();
|
||||
});
|
||||
router.beforeEach(() => {
|
||||
timeMetric.pageStart = Date.now();
|
||||
});
|
||||
nuxt.hook("page:finish", () => {
|
||||
timeMetric.pageEnd = Date.now();
|
||||
});
|
||||
const ssrState = useState("__nuxt_devtools__", () => ({}));
|
||||
watchEffect(() => {
|
||||
if (ssrState.value.timeSsrStart)
|
||||
timeMetric.ssrStart = ssrState.value.timeSsrStart;
|
||||
});
|
||||
import("./view/client.js").then(async ({ setupDevToolsClient }) => {
|
||||
await setupDevToolsClient({
|
||||
nuxt,
|
||||
clientHooks,
|
||||
timeMetric,
|
||||
router
|
||||
});
|
||||
const isMac = typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac");
|
||||
console.log(
|
||||
`\u2728 %cNuxt DevTools %c Press Shift + ${isMac ? "Option" : "Alt"} + D to open DevTools`,
|
||||
"color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #00DC82",
|
||||
"border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #00DC8220",
|
||||
""
|
||||
);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue