Skip to content

Commit 44b2a75

Browse files
committed
Step 6 - Computed
1 parent 222a37e commit 44b2a75

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/app.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
<a v-on="click:remove(todo)">[x]</a>
1414
</li>
1515
</ul>
16+
<div v-show="todos.length">
17+
<strong>
18+
{{ remaining }} {{ remaining | pluralize 'item' }} remaining
19+
</strong>
20+
</div>
1621
</template>
1722

1823
<script>
@@ -22,6 +27,10 @@ export default {
2227
input: ''
2328
},
2429
30+
computed: {
31+
remaining() { return this.todos.filter(todo => !todo.completed).length; }
32+
},
33+
2534
methods: {
2635
add() {
2736
var value = this.input.trim();

0 commit comments

Comments
 (0)