Skip to content

Instantly share code, notes, and snippets.

@mallardduck
Last active January 10, 2025 15:07
Show Gist options
  • Save mallardduck/96c43dcd6a054dd9616dc9fbb9cb6fdd to your computer and use it in GitHub Desktop.
Save mallardduck/96c43dcd6a054dd9616dc9fbb9cb6fdd to your computer and use it in GitHub Desktop.
Enable Vue DevTools in Prod
// vue2
const app = Array.from(document.querySelectorAll('*')).find((e) => e.__vue__).__vue__
const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__
devtools.enabled = true
const Vue = Object.getPrototypeOf(app).constructor
while (Vue.super) {
Vue = Vue.super
}
Vue.config.devtools = true
devtools.emit('init', Vue)
// vue3
const app = Array.from(document.querySelectorAll('*')).find((e) => e.__vue_app__).__vue_app__
const version = app.version
const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__
devtools.enabled = true
devtools.emit('app:init', app, version, {})
Then: Alt+R, or Option+R, on Devtools window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment