Vue-router: Transition on Parameter Change

Created on 12 Dec 2016  ·  1Comment  ·  Source: vuejs/vue-router

Hey awesome vue people! :D
We are just wondering, how can we actually trigger a transition on params change?

So this is working for something like /home to /post

      <transition :name="transitionName">
        <router-view class="child-view"></router-view>
      </transition>

But when I try this: /post/123 to /post/323
I have no transition =/

Is there a (global) solution to transition also the param changes?

Thank you so much!

Most helpful comment

Hello!

This is a usage question, and we encourage you to ask it on forum or gitter. We try to use the issue tracker for bug reports and feature requests.

As for the question, you can do that with <router-view :key="$route.params.<your_param>">.

>All comments

Hello!

This is a usage question, and we encourage you to ask it on forum or gitter. We try to use the issue tracker for bug reports and feature requests.

As for the question, you can do that with <router-view :key="$route.params.<your_param>">.

Was this page helpful?
0 / 5 - 0 ratings