Weekly Vue.js News - #52 - v-if vs. v-show
Expect missing links and broken styling, as this issue has been migrated from my previous newsletter service.
I'm still on our honeymoon, so you can expect more introductory words in the next issues.
In this issue, I have curated a few interesting articles and tweets to help you in your journey to become a Vue expert.
Have a great week ☀️
Vue Tip: v-if vs. v-show
v-if entirely creates and destroys the element, including event listeners and child components:
Example template using v-show
v-show creates the element and toggles its visibility using CSS.
v-if has higher toggle costs while
v-show has higher initial render costs.
v-show if you need to toggle something very often, and
v-if if the condition is unlikely to change at runtime.