Learning-Is-Vital-In-Development / 23-12-FrontendPerformanceOptimizationGuide

3 stars 5 forks source link

2장 note #17

Open dogyeong opened 11 months ago

dogyeong commented 11 months ago
dogyeong commented 11 months ago

Vue에서 v-if vs v-show

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.

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

dogyeong commented 11 months ago

solidjs에서 조건부 렌더링

https://www.solidjs.com/tutorial/flow_show

<Show
  when={loggedIn()}
  fallback={<button onClick={toggle}>Log in</button>}
>
  <button onClick={toggle}>Log out</button>
</Show>