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

Consider v-show instead of v-if for v-wait component #45

Open
anorborg opened this issue Jul 4, 2018 · 1 comment
Open

Consider v-show instead of v-if for v-wait component #45

anorborg opened this issue Jul 4, 2018 · 1 comment

Comments

@anorborg
Copy link

anorborg commented Jul 4, 2018

I noticed while I was uisng the v-wait component, my component that I was wrapping was being created twice. First on initial load, then again after my call to my API to load the data. Looking over the source and the vuejs docs I saw this:

https://vuejs.org/v2/guide/conditional.html#v-if-vs-v-show

Which states that:

"...child components inside the conditional block are properly destroyed and re-created during toggles"

I wonder if it would be better for v-wait to use v-show instead? Or add an option?

@avinograd0v
Copy link

avinograd0v commented Aug 22, 2018

I think more correct way is using v-if when v-wait first mounts, and then using v-show for future updates

Another way is to add option for v-wait (something like v-once) to trigger conditional render only once for waiter with specific name

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