Enable Vue devtools in Production

0 views
  1. Press F12 to open devtool console page.

  2. Execute following code:

    Vue2.x

    const app = Array.from(document.querySelectorAll("*")).find(
      (e) => e.__vue__
    ).__vue__;
    const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
    const Vue = Object.getPrototypeOf(app).constructor;
    while (Vue.super) {
      Vue = Vue.super;
    }
    Vue.config.devtools = true;
    devtools.emit("init", Vue);
    

    Vue3.x

    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, {});
    
  3. Press Option/Alt + R to refresh the devtool, now you can see the Vue tab is show.

Or install Chrome extension Vue force dev

CC BY-NC-SA 4.0 2020-PRESENT © YuYinWS