current position:Home>Vue content summary
Vue content summary
2022-04-29 09:42:12【Aaron Con】
Catalog
1. vue Understanding the life cycle of
vue Hook function of life cycle
- beforeCreate
Instance just created in memory , It's not initialized yet data and methods - created
The instance has been created in memory , here data and methods Created - beforeMount
At this point, the compilation of the template is completed , But not rendered to the interface - mounted
The template has been rendered to the browser , The creation phase is complete , Coming into operation - beforeUpdate
Call... When data is updated , Suitable for accessing existing before updating DOM - updated
The page is re rendered , Data and in the page data bring into correspondence with - beforeDestroyed
Call before instance destruction , The instance is still available - destroyed
Call after instance destruction , If the hook function is called , Corresponding vue All instructions of the instance are unbound , All time listeners are removed , Sub instances are also destroyed
2. vue Parent child component life cycle call order
- Load Render Pass
Father beforeCreate -> Father created -> Father beforedMount -> Son beforeCreate -> Son created -> Son beforeMount -> Son mounted -> Father mounted - Subcomponent update process
Father beforeUpdate -> Son beforeUpdate -> Son updated -> Father updated - Destruction process
Father beforeDestroy -> Son beforeDestroy -> Son destroyed -> Father destroyed
3. keep-alive Understanding of components
- keep-alive Components : It is an abstract component , It does not render itself DOM Elements , Use keep-alive When wrapping dynamic components , Will cache inactive component instances instead of destroying them
- scene : When we use dynamic components to switch content , Direct switching will cause the previous component state to return to the default state , We can cache the previous state through keep-alive Dynamic package components
4. vue In which life cycle are asynchronous requests invoked
- created、beforeMount、mounted
- Recommended in the created The asynchronous request is invoked in the hook function
- comparison beforeMount、mounted Faster access to server data 、 Reduce pages loading Time
- ssr( Server rendering ) I won't support it beforeMount、mounted Hook function
5. vue-if and v-show The difference between
- The same thing : Control the display and hiding of elements
- Difference :
- v-show The first rendering will be compiled , Will add elements to DOM Node , adopt display: none Control hide , Will trigger page redrawing
- v-if Whether to compile will be determined according to the true or false condition , Every time conditions change, they will tell DOM Node to add or remove elements , Will trigger page reflow , And cause redrawing
copyright notice
author[Aaron Con],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204290746051644.html
The sidebar is recommended
guess what you like
Ajax learning notes
Relearn react (1) - recognize the life cycle
Small problems encountered by react usereducer and Solutions
CSS realizes the square of adaptive screen width
Nginx + ModSecurity setup
Bootstrap web job
bootstrap
Swoft 2. X Foundation (HTTP, database, redis)
Docker actual combat case 2: nginx load balancing
Vue basic syntax
Random recommended
- Go basic syntax 3 (socket, httpserver)
- Nginx configures HTTPS and calls http
- Nginx parsing vulnerability
- How can the backend package Vue projects quickly
- Netty configures WSS protocol access through nginx (Practical)
- Total permutation problem_ Not containing the same element and containing the same element_ Leetcode46_ Leetcode47_ Backtracking solution + java code
- How to upload and download files using Axios in nodejs
- Vue excel file upload
- CondaHTTPError: HTTP 000 CONNECTION FAILED for url < https://conda.anaconda.org/fastai/noarch/repodat
- Multi function environmental monitoring pole scheme based on wireless gateway
- JPS in Hadoop, but http://hadoop01:50070/ How to solve the problem if there is no interface? 500ha70 cluster can't be accessed?
- Tool class for obtaining specific information in HTTP request
- UAV project tracking record 65 - wireless transceiver module circuit
- UAV project tracking record 76 - wireless transceiver module circuit
- Basic concept of angular velocity
- Front end login password encryption and decryption
- Vue parent-child component mutual transmission and intermodulation
- Vue nested loop array, select one of them and add the selected style
- The Vue seamless scroll list scrolls automatically
- Vue line graph moves dynamically to the right
- Install and configure nginx in Linux Environment
- Vue dynamically binds attributes and dynamically obtains attribute values
- Summary method of Vue value in key pair mapping
- Vue simply realizes the addition, deletion and modification of each tab page without route jump
- Vue time control common processing
- Vue validation array
- Simple and easy to let you know what AJAX is, even if you are a little white, a rookie can understand it!
- Receive the JSON string from the front end, and summarize the methods of parsing and value taking at the back end
- Solution: httpmessagenotreadableexception: JSON parse error: invalid UTF-8
- Vuetify: install vuetify from scratch
- Install CSS from tailwind
- Ubuntu 16 wireless network card model query and driver installation, Lenovo g400 bcm43142 network card WiFi
- Some color knowledge to understand at the front end
- Functional programming of front-end development
- A front-end interview question -- implementing an encapsulated Ajax device (promise version)
- Dynamic components of angular
- Front end written test pit -- JS implicit conversion
- Shallow understanding of HTTP
- React style modification background invalid
- Finding the k-th small element of ordered matrix (dichotomy idea)