Skip to content

Colada data loader doesn't query on route param change #649

@imyourm8

Description

@imyourm8

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugthis isn't working as expected🔄 data-loadersrelated to Data Loaders

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions