vue router keep-alive属性

匹配的组件会被缓存

<template>
  <div id="app">
    <img src="./assets/logo.png">
    <router-link to="/Quange">Quange</router-link>
    <router-link to="/Furong">Furong</router-link>
    <keep-alive include="Quange,Furong">
      <router-view />
    </keep-alive>
  </div>
</template>

匹配的组件都不会被缓存

<template>
  <div id="app">
    <img src="./assets/logo.png">
    <router-link to="/Quange">Quange</router-link>
    <router-link to="/Furong">Furong</router-link>
    <keep-alive exclude="Quange,Furong">
      <router-view />
    </keep-alive>
  </div>
</template>
posted @ 2021-07-09 15:12  thomas_blog  阅读(64)  评论(0编辑  收藏  举报