1. The function is similar to the tab component, which can be used to switch components
2. The is attribute determines the component currently rendered by the component. The is attribute can be a component or a string. When it is a string, it represents the registered name or tag name of the component.
3. Any parameter and event can be uploaded to component dynamic components, and will be received by all current components on is
Simply put, component is like a container, which component to render is determined according to the is attribute, and there is no difference in other
v-if switching these will cause the destruction of the component, which will be monitored here
//组件卸载unmounted(){
},
Disadvantage, the state of the data is not saved
Keep alive, wrap it with keep-alive
keep-alive has some properties
1. The name stored in include is the name attribute of the component itself, and only components with matching names will be cached
2, exclude, any component with a matching name will not be cached
3, max, how many component instances can be cached at most, once this number is reached, the instance in the cache component that has not been cached recently will be destroyed
By default, in the process of building the entire component tree, because components and components are directly dependent on modules, then wbpack will package the component modules together when packaging
At this time, as the project continues to grow, the content of the app.js file is too large, which will cause the rendering speed of the first screen to slow down
When packaging, the subpackage of the code
For some components that do not need to be used immediately, they can be split separately and split into some small code blocks chunk.js
These chuck.js will be loaded from the server when needed and run the code