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

Reactivity problem when using v-translate in combination with v-if (since 2.1.0) #79

Closed
Nivani opened this issue Oct 23, 2018 · 2 comments

Comments

@Nivani
Copy link

Nivani commented Oct 23, 2018

When using v-translate in combination with v-if, reactivity is lost.

This jsfiddle demonstrates the problem:
http://jsfiddle.net/eywraw8t/429637/

When clicking the buttons at the top you will see that the bottom label (that uses v-translate) is not reactive.

Lowering the version of vue-gettext to 2.0.31 fixes the problem: http://jsfiddle.net/eywraw8t/429660/

@kemar
Copy link
Contributor

kemar commented Oct 23, 2018

Yes, this is how the plugin works since v2.1.0.

It's up to the developper to add a key attribute manually for such cases. You can read about Vue rendering mechanism here.

You can also tell the plugin to generate key attributes automatically by enabling the autoAddKeyAttributes config option introduced in v2.1.0, but it can lead to another set of problems.

See issues #29 and #66 for the full history.

@kemar kemar closed this as completed Oct 23, 2018
@Nivani
Copy link
Author

Nivani commented Oct 23, 2018

Aha, you're right. Didn't search the issues thoroughly enough

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

No branches or pull requests

2 participants