Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
190
rated 0 times [  192] [ 2]  / answers: 1 / hits: 5528  / 4 Years ago, mon, august 31, 2020, 12:00:00

How to call Vue instance in chrome console, if it created in a separated file new Vue({ ... }). Like console.log(vm.user.id)




new Vue({
el: '#app',
data: {
message: {
id: 1,
title: 'TEST VUE'
}
}
});




More From » vue.js

 Answers
0

If you have the Vue DevTools installed it will create aliases for your Vue instances when you click on them:


Vue


Note the light text to the right of the component name. It may be hard to see on some screens.


In the picture above, $vm1 and $vm2 are accessible in the console and will refer to the corresponding Vue instances.


As you click around in the DevTools these aliases will change. $vm0 will refer to the last component you clicked on.


[#2778] Wednesday, August 26, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaredsages

Total Points: 273
Total Questions: 97
Total Answers: 105

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
jaredsages questions
;