Skip to content

Instantly share code, notes, and snippets.

View DezChuang's full-sized avatar
🎯
Web Dev

CK Chuang DezChuang

🎯
Web Dev
View GitHub Profile
@DezChuang
DezChuang / v-devtools.js
Created January 26, 2022 09:09 — forked from schaoss/v-devtools.js
Force Open Vue Devtools
(() => {
// find root element: nuxt instance, #app, first div child in <body>
const root = window?.$nuxt?.$el || document.getElementById('app') || [...document.body.children].find(i => i.tagName === 'DIV');
const app = root?.__vue__;
if (!app || !window.__VUE_DEVTOOLS_GLOBAL_HOOK__) return 0;
const Vue = app.constructor;
const VueSuper = Vue.super || Vue;
VueSuper.config.devtools = true;