In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what is the life cycle function in Vue", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the life cycle function in Vue" this article.
Life cycle function
Life cycle function is also called: life cycle callback function, life cycle function, life cycle hook
What is it: Vue calls some functions with special names for us at critical moments
The name of the lifecycle function cannot be changed, but the specific content of the function is written by the programmer according to the requirements.
The this in the lifecycle function points to the vm or component instantiation object.
Commonly used life cycle hooks
1. Mounted: send ajax request, start timer, bind custom event subscription message and other functions [initialization]
2. BeforeDestory: clear timer, unbind custom events, unsubscribe messages, etc. [start and end]
About Vue terminating an instance:
1. After destruction, you cannot see any information with the help of Vue developer tools.
2. After termination, the custom event will fail, but the native DOM event is still valid.
3. Generally, data will not be manipulated in beforeDestory, because even if data is manipulated, the update process will no longer be triggered.
Welcome to learn the life cycle point of Vue. I stop changing Vue.config.productionTip = false. Const vm = new Vue ({el:'# root', data: {opacity: 1,}, methods: {stop () {/ / clearInterval (this.timer) this.$destroy () }}, / / Vue calls mounted mounted () {this.timer = setInterval (()) > {this.opacity-= 0.01; if (this.opacity) after the template parsing is completed and the real initial DOM elements are placed on the page (after loading is completed)
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.