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

directive on vue-router does not run update hook when created inside functional component #2636

Closed
species7213uv opened this Issue Mar 4, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@species7213uv
Copy link

species7213uv commented Mar 4, 2019

Version

3.0.2

Reproduction link

https://jsfiddle.net/xqge8a2m/

Steps to reproduce

First of all, apologies, because my jsfiddle seems to have a different problem. There the render function of the functional component is performed each time the route changes. I don't understand why.
This does not occur in my project, which I tried to reproduce.
There I get the "inserted" hook, but never the updated, even if I press the links and change the route (and the activeClasses gets updated)

What is expected?

The directives update hook should be triggered

What is actually happening?

The updated hook is not triggered. Only the inserted (when I first render the page). Then nothing more.


I am using the latest vue version 2.6.8.

@posva

This comment has been minimized.

Copy link
Member

posva commented Mar 4, 2019

functional components are always re rendered, so the whole thing is updated every time. You probably want to use the inserted hook on top of the updated hook


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

@posva posva closed this Mar 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.