View profile

Weekly Vue.js News - #52 - v-if vs. v-show

Michael Hoffmann (Mokkapps)
Michael Hoffmann (Mokkapps)
Hi 👋
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
During toggles, v-if entirely creates and destroys the element, including event listeners and child components:
Example template using v-if
Example template using v-if
v-show creates the element and toggles its visibility using CSS.
Example template using v-show
Example template using v-show
v-if has higher toggle costs while v-show has higher initial render costs.
Prefer v-show if you need to toggle something very often, and v-if if the condition is unlikely to change at runtime.
Vue Articles
JavaScript Tip: Display tabular data as a table using console.table
Web Development Articles
Quote of the week
Tools & Misc
Did you enjoy this issue? Yes No
Michael Hoffmann (Mokkapps)
Michael Hoffmann (Mokkapps) @mokkapps

Hi 👋

My name is Michael Hoffmann and I'm a Senior Frontend Developer, Freelancer and Blogger.

I focus on Vue.js, JavaScript, TypeScript and Spring Boot. Occasionally I also give career & freelancer advice.

My weekly emails reflect this preference.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.
Holzapfelkreuther Straße 19, 81375 Munich, Germany