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>

vue router keep-alive属性

上一篇:hive爬坑


下一篇:教你 PXE高效批量网络装机