What does the dollar symbol refer to in vue
This article mainly introduces the relevant knowledge of what the dollar symbol refers to in vue, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value, I believe you will have something to gain after reading what the dollar symbol in this vue refers to. Let's take a look.
The dollar symbol in vue is a special tag with no special meaning, and its main function is to enhance the distinction; you can distinguish between built-in instance method properties and user-defined properties, and you can avoid overrides caused by self-declaration or adding custom attributes.
This article operating environment: windows10 system, Vue2.9.6 version, DELL G3 computer.
What does the dollar symbol mean in vue?
The Vue instance also exposes some useful instance properties and methods. They all have the prefix $to distinguish them from user-defined attributes.
It's just a special mark. Enhance the distinction to show that this is a built-in instance method property.
Avoid overriding by declaring or adding custom attributes ourselves
For example:
Var data = {a: 1} var vm = new Vue ({el:'# example', data: data}) vm.$data = data / / = > truevm.$el = document.getElementById ('example') / / > true// $watch is an instance method vm.$watch (' averse, function (newValue, oldValue) {/ / this callback will be called after the `vm.a` change}). This is the end of the article on "what does dollar symbol in vue refer to?" Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what does the dollar symbol in vue refer to". If you want to learn more knowledge, you are welcome to follow the industry information channel.