Search code examples
javascriptwebpackvue.jsvuejs2vue-devtools

How do Vue devtool detect Vue on the webpage?


When i was using webpack, I cannot access window.Vue, but the vue devtool can still work to tell whether the webpage uses vue, no matter in development mode or not.

Angular and react have their devtools too, which, i believe, can do the job as well.

I want to know, does the tool managed to access the Vue object through other methods? or is it something related to webpack?


Solution

  • Vue devtools scans the DOM looking for DOM elements that have the __vue__ property.

    Here is the code.