keep-alive
Keep-alive is an abstract component built into Vue that allows contained components to remain in state, avoiding repeated component creation and rendering
Keep-alive is generally used in combination with routing and dynamic components to cache components.
<keep-alive>
<component :is='current'></component>
</keep-alive>
Keep-alive provides include and exclude attributes, both of which support strings or regular expressions. Include means that only components with matching names will be cached. Exclude means that any components with matching names will not be cached.
<keep-alive :include="includeList" :exclude="excludeList">
<router-view></router-view>
</keep-alive>
Keep-alive caches include matching components and does not cache exclude matching components.
Read More:
- Using UMI plugin keep alive to realize keep alive state storage in UMI Ant Design
- Vue router click the menu bar and the same module reports an error Vue router.esm.js? 2215:2065 Uncaught (in promise) Error
- Problems and solutions of error reporting in using swiper in Vue
- Register global time filter in main.js in Vue
- Solve the error of clearing data in object.assign in Vue
- Error in require.context in vue3 vite
- Idea installation vue.js After plug-in, new has no Vue component
- About iView reporting error in Vue project: error in mounted hook: “typeerror: this$ parent.updateNav is not a function”
- Declarative development tab in Vue
- When writing a website, Vue + Flash prompts network error when visiting Vue page
- Encapsulation of Axios and management of API interface in Vue
- Syntax error in Vue ie10 browser
- Cannot read property ‘substring’ of undefined in Vue
- The problem that the El icons icon cannot be displayed in vue3 + element plus + vite
- An error is reported when the electron Vue Vue component introduces the electron
- Vue error in render: “typeerror: cannot read property ‘name’ of undefined”
- The influence of the loading order of props, data and computed in Vue
- Error code elifecycle errorno when NPM install command is executed in Vue project
- The problem of error in adaptation of Vue using vant mobile terminal rem
- Invalid host header error in Vue using peanut shell agent