Skip to content

Instantly share code, notes, and snippets.

@autotrof
Created July 23, 2023 01:43
Show Gist options
  • Save autotrof/de893f7c9ae7b660bd88b75472c6fd4b to your computer and use it in GitHub Desktop.
Save autotrof/de893f7c9ae7b660bd88b75472c6fd4b to your computer and use it in GitHub Desktop.
force enable vue dev-tools in
// source : https://mokkapps.de/vue-tips/force-enable-vue-devtools-in-production-build
const enableDevTools = () => {
const app = Array.from(document.querySelectorAll('*')).find((e) => e.__vue__).__vue__
const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__
devtools.enabled = true
let Vue = Object.getPrototypeOf(app).constructor
while (Vue.super) {
Vue = Vue.super
}
Vue.config.devtools = true
devtools.emit('init', Vue)
}
// then pres option + r in console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment