keepAlive

作者: royluck | 来源:发表于2019-03-26 10:49 被阅读0次
    配置两个地方:

    1:

          <keep-alive>
              <router-view v-if="$route.meta.keepAlive"></router-view>
          </keep-alive>
          <router-view v-if="!$route.meta.keepAlive"></router-view>
    

    2:

    {
            path: '/orderList',
            name: 'orderList',
            component: OrderList,
            title: '订单列表',
            meta: {
                keepAlive: true // 缓存
            }
        },
    
    备注:
    :key=date,用于:刷新当前路由 router-view中的内容,但是这样感觉会跟keepAlive冲突

    相关文章

      网友评论

          本文标题:keepAlive

          本文链接:https://www.haomeiwen.com/subject/aczwvqtx.html