DEV Community

Discussion on: Vue Academy #4: v-for directive

Collapse
jamesthomson profile image
James Thomson

Small tip. You can use template with v-if/else to avoid unwanted elements in the DOM.

Instead of

<div v-if="numberList.length === 5" >
Enter fullscreen mode Exit fullscreen mode

do this

<template v-if="numberList.length === 5" >
Enter fullscreen mode Exit fullscreen mode
Collapse
codeoz profile image
CodeOz Author

Nice tips James! Totally agree!