Keep-alive is a built-in component of the VUE that allows the contained component to be left in a preserved state or to avoid being rerendered.
<div>
<keep-alive>
<router-view></router-view><!-- The components in this are cached in the-->
</keep-alive>
</div>
Next, let’s combine the Settings of router caching section page
in app.vue
<template>
<div id="app">
<!-- This is with the components. -->
<!-- add cache -->
<keep-alive>
<router-view v-if="this.$route.meta.keep"></router-view>
</keep-alive>
<router-view v-if="!this.$route.meta.keep"></router-view>
</div>
</template>
Add the configuration meta
router to configure keep, which requires true cache instead of false
{
path: '/shop_detail',
name: 'shop_detail',
component: shop_detail,
meta:{
keep:true // keep(optional name) true means the page needs to be cached.
}
},
{
path: '/details',
name: 'details',
component: details,
meta:{
keep:false // keep(optional name) false means the page does not need to be cached.
}
},









basically means that you have a problem with the order of each project build of this project, then I have a look according to the instructions, and sure enough, I have a dependency which is not checked. Here the project depends on your own mind to know ~ method 1: Menu-& GT; Project-> Project Dependencies method 2: Right Click Soultion -& GT; properties-> Project Dependencies is perfectly solved, but today CSDN’s Markdown seems to be a little buggy




