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

v-link-active does not work when v-link is on a component #383

Closed
simplesmiler opened this issue Feb 23, 2016 · 2 comments
Closed

v-link-active does not work when v-link is on a component #383

simplesmiler opened this issue Feb 23, 2016 · 2 comments
Labels

Comments

@simplesmiler
Copy link
Member

Repro: http://jsfiddle.net/simplesmiler/g61g06gr/

I found this while playing around with the idea of BEM directive. I needed a way to look up the local DOM tree for the directive that defined a block, and I decided to follow the example of v-link/v-link-active of setting a custom flag on the element. But apparently this does not work when v-link is put on the component, because component node is compiled before the rest of the template.

Is there any other way for two vertically separated directives to talk?

@simplesmiler
Copy link
Member Author

I guess I could try to signal the intention to the parent vm (assuming one component equals one block), and then execute things in correct order in the compiled hook.


UPDATE: it will take a lot of effort to make this approach work with dynamic (v-if and v-for) elements.

@yyx990803
Copy link
Member

Fixed in 3d12e95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants