In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian for you to introduce in detail "vue how to use refs to get the value of nested components", detailed content, clear steps, details handled properly, I hope that this "vue how to use refs to get the value of nested components" article can help you solve doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.
Use refs to get the value of a nested component
Function introduction:
1. The parent component contains zujian1, while zujian1 contains zujian2.
2. Zujian2 binds an input parameter
3. The parent component gets the value in the input box through this.$refs. Component name to get the dom element, multiple layers of nesting, need to be adjusted multiple times
/ / record the benefits of this.inputValue=this.$refs.zujian1.$refs.zujian2.queryvue using ref for the value of the input box
When we need to access the subcomponents directly in JavaScript.
To do this, you can use ref to specify a reference ID for the subcomponent
Var parent = new Vue ({el:'# parent'}) / / access the subcomponent instance var child = parent.$refs.profileconsole.log (child) / /
This is the same as document.getElementById ("profile") for acquiring dom nodes, but using ref reduces the consumption of getting dom nodes.
When ref and v-for are used together, the obtained reference is an array of subcomponents corresponding to the circular data source.
Read this, the "vue how to use refs to obtain the value of nested components" article has been introduced, want to master the knowledge of this article still need to practice and use to understand, if you want to know more about the article, 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.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.