We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vue] 怎么缓存当前打开的路由组件,缓存后想更新当前组件怎么办呢?
The text was updated successfully, but these errors were encountered:
可以在路由meta中加入参数, 对打开的路由进行keep-alive的判断, 通过钩子active等
Sorry, something went wrong.
优秀~
https://blog.csdn.net/qq_38861711/article/details/98185106
设置缓存:
<keep-alive> <router-view v-if="$route.meta.keepAlive" /> </keep-alive> <router-view v-if="!$route.meta.keepAlive" />
更新当前组件,设置不同:key键;activated中更新数据;
1.通过keep-alive组件可以缓存 组件,通过路由配置中的meta选项中的自定义属性trueorfalse决定缓存,或者使用include属性来添加缓存的组件 2.key值的改变组件会进行重建,因此可以再actived中改变key值
No branches or pull requests
[vue] 怎么缓存当前打开的路由组件,缓存后想更新当前组件怎么办呢?
The text was updated successfully, but these errors were encountered: