-
-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Labels
🐞 bugthis isn't working as expectedthis isn't working as expected🔄 data-loadersrelated to Data Loadersrelated to Data Loaders
Description
Very easy to reproduce. Take existing example https://github.com/posva/unplugin-vue-router/tree/main/examples/nuxt
Change App.vue to
<script setup lang="ts">
import { useState } from '#imports'
const state = useState('custom-date', () => new Date().toUTCString())
</script>
<template>
<div>Hello {{ state }}</div>
<nav>
<NuxtLink to="/">Home</NuxtLink>
|
<NuxtLink to="/users/24" v-slot="{ route }">{{ route.href }}</NuxtLink>
|
<NuxtLink to="/users/colada-24" v-slot="{ route }">{{
route.href
}}</NuxtLink>
<NuxtLink to="/users/colada-25" v-slot="{ route }">{{
route.href
}}</NuxtLink>
<NuxtLink to="/users/colada-26" v-slot="{ route }">{{
route.href
}}</NuxtLink>
<NuxtLink to="/users/colada-27" v-slot="{ route }">{{
route.href
}}</NuxtLink>
</nav>
<NuxtPage />
</template>
Start from /users/colada-*
links and observe data loader querying data only once. After that no queries will be fired and data will stay outdated. If you start from "Home" page and click on links - it will work as expected.
JoJk0
Metadata
Metadata
Assignees
Labels
🐞 bugthis isn't working as expectedthis isn't working as expected🔄 data-loadersrelated to Data Loadersrelated to Data Loaders
Projects
Status
🆕 New