Conditional Rendering | Vue.js thumbnail
Conditional Rendering | Vue.js
vuejs.org
toggle more than one element? When v-if and v-for are both used on the same element, v-if will be evaluated first. Generally speaking, v-if has higher toggle costs while v-show has higher initial render costs. So prefer v-show if you need to toggle something very often, and prefer v-if if the condit
6 Users
0 Comments
39 Highlights
2 Notes

Top Highlights

  • toggle more than one element?
  • When v-if and v-for are both used on the same element, v-if will be evaluated first.
  • Generally speaking, v-if has higher toggle costs while v-show has higher initial render costs. So prefer v-show if you need to toggle something very often, and prefer v-if if the condition is unlikely to change at runtime.
  • It's not recommended to use v-if and v-for on the same element due to implicit precedence. Refer to style guide for details.
  • conditionally render a block

Domain

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.