Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

What I want to get:

There are two list Page , and you can enter their detail page

if I from list page to detail , then back to list page .The list page should be cache.

but form list page to another list page ,then back. The list page shouldn't be cache.

so , I want to control the list Page cache or not

what I do now

<router-view v-slot="{ Component }"> <keep-alive :include> <component :is="Component" /> </keep-alive> </router-view>

`
const include =ref('')

const route = useRoute()

watch(()=>route.path,(newVal)=>{
if(newVal==='pagelist1'||newVal==='pagelist1detail'){
include.value = 'pagelist1'
}else if(newVal==='pagelist2'||newVal==='pagelist2detail'){
include.value = 'pagelist2'
}else{
include.value = 'nostore'
}
}
)
`
There is more elegrant way to solve it?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.