Vue, what does $ means?

Asked by At

I'm learning Vue.js and I don't understand what does the $ symbols does. Im using Laravel, I mean I'm not using the Vue-CLI. When I go to the Vue documentation, a lot of the documents does not have the $.

For example the Programmatic Navigation section says: router.push({ path: '/posts' }), but when I did it on my code I had to do this.$router.push({ path: '/posts' });

Thanks in advance.

2 Answers

5
Takachi On Best Solutions

In Vue, $ means that you're using a Vue instance property or an Vue instance method.

You can learn more about it on the documentation.

0
Kelvin Omereshone On

It's a naming convention in Vue, it basically used to identify that you are referencing a property or method on the vue instance you instantiated.