Optimisation Doubt. From Vue Js - Tutorial. Related to Toggling List Items Based on Button Click #12785
Unanswered
RamanathRam
asked this question in
Help/Questions
Replies: 2 comments
-
or both are same ? will the second method still go through all list items ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Well, both are the same, but could you let me know which one you need to choose? and in the <ul>
<template v-for="todo in todos" :key="todo.id">
<li v-show="!hideCompleted || !todo.done"> // or v-if
<input type="checkbox" v-model="todo.done">
<span :class="{ done: todo.done }">{{ todo.text }}</span>
<button @click="removeTodo(todo)">X</button>
</li>
</template>
</ul> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Which is better ?
what are the pros & cons of each one. Thanks in advance.
Mentioned In Tutorial is this method
OR
Alternate Method (Toggling The Checklist Items) :
Beta Was this translation helpful? Give feedback.
All reactions