Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2.0-beta.2: Follow up on #4148 #4157

Closed
AlexandreBonaventure opened this issue Jul 20, 2021 · 2 comments
Closed

3.2.0-beta.2: Follow up on #4148 #4157

AlexandreBonaventure opened this issue Jul 20, 2021 · 2 comments

Comments

@AlexandreBonaventure
Copy link
Contributor

Version

3.2.0-beta.2

Reproduction link

https://github.com/AlexandreBonaventure/vue3.2-bug
(updated to use 3.2.0-beta.2)

Steps to reproduce

This issue is a follow-up on: #4148
Seems like the fix is not entirely comprehensive because I was able to reproduce with the new beta version by adding another route wrapper component

What is expected?

no errors

What is actually happening?

error

@posva
Copy link
Member

posva commented Jul 20, 2021

Also reproducible with a much simpler version similar to #4148 (comment)

import { h } from 'vue';
import { createRouter, createWebHistory, RouteRecordRaw, RouterView } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: { render: () => h(RouterView)},
    children: [
      {
        name: 'a',
        path: 'a/:id',
        component: () => import('./ARoute.vue'),
      },
      {
        name: 'b',
        path: 'b',
        component: { render: () => h('div', 'B content') },
      },
    ]
  },
];

export const router = createRouter({
  history: createWebHistory(),
  routes,
})

ARoute.vue

<template>
  <pre>{{ $route.params.id.toUpperCase() }}</pre>
</template>

App.vue

<template>
  <nav class="flex pa4" style="gap: 30px">
    <RouterLink :to="{ name: 'a', params: { id: 'test' } }">Go to A</RouterLink>
    <RouterLink :to="{ name: 'b' }">Go to B</RouterLink>
  </nav>
  <RouterView />
</template>

I could reproduce this without Vue Router but I'm unsure if that usage of the computed makes sense.

@yyx990803
Copy link
Member

It seems the computed change introduces too many edge cases and is too risky so I reverted it to the old behavior :/

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2023
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

3 participants