Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

如何保证tab在切换的时候 , 搜索记录仍在? #11

Closed
dingxihao1991 opened this issue Oct 29, 2019 · 1 comment
Closed

Comments

@dingxihao1991
Copy link

1572339809(1)

@woai3c
Copy link
Owner

woai3c commented Oct 30, 2019

你看一下 demo 切换 tab 的时候,是不会刷新的,原来的内容保持原样。
文档中也有说明要怎么设置才能在 tab 切换页面时,不清空内容。

注意: 组件的名称和路由的名称一定要一致,例如 Home.vue 组件名称 name: home,则在路由文件中也要给它设置为 name: home,否则页面内容不能缓存

// 在router文件中
{
    path: 'home',
    name: 'home',
    component: () => import('../views/Home.vue')
}

// 在Home.vue中
export default {
    name: 'home'
}

@woai3c woai3c closed this as completed Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants