@nuxt/devtools
Version:
<a href="https://devtools.nuxt.com"><img width="1200" alt="Nuxt DevTools" src="https://github-production-user-asset-6210df.s3.amazonaws.com/904724/261577617-a10567bd-ad33-48cc-9bda-9e37dbe1929f.png"></a> <br>
24 lines (23 loc) • 503 B
JavaScript
import { shallowRef } from "vue";
export function useNuxtDevTools() {
const r = shallowRef();
if (!process.dev)
return r;
if (import.meta.server)
return r;
if (window.__NUXT_DEVTOOLS_HOST__) {
r.value = window.__NUXT_DEVTOOLS_HOST__;
} else {
Object.defineProperty(window, "__NUXT_DEVTOOLS_HOST__", {
set(value) {
r.value = value;
},
get() {
return r.value;
},
enumerable: false,
configurable: true
});
}
return r;
}