Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the dollar symbol refer to in vue

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report