Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vuejs : is it possible to name Vue instances in vue-devtools?

I'm implementing a web page with multiple Vue instances.

I have a simple question : is it possible to name and display them under their name with vue-devtools?

Actually my console displays instances like this and it is hard to distinguish them :

vue-devtools

like image 581
Sebastien D Avatar asked Mar 07 '18 12:03

Sebastien D


People also ask

Can you have multiple Vue instances?

It is totally legal and fine to have multiple Vue instances on your page controlling different parts and pieces of it. In fact, you can even have your instances communicate with each other by storing them in variables within the global namespace.

Does Vue Devtools work for vue3?

Vue Devtools 6 supports Vue 3 and as of right now it's in beta and available for Chrome and Firefox.


1 Answers

By "multiple instances of Vue", if you mean you have multiple new Vue({}) instances, then you can give each its own name as:

new Vue({
  name: 'Samayo'
})

And now the <Root> in your devtools will be replaced with <Samayo>

like image 168
samayo Avatar answered Sep 21 '22 00:09

samayo