A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/amejiarosario/vue-todo-app/commit/24ae5a0f74c226325d88a2aaecad9e40b35760fb below:

Items left count with `computed` properties · amejiarosario/vue-todo-app@24ae5a0 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+7

-2

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+7

-2

lines changed Original file line number Diff line number Diff line change

@@ -31,5 +31,10 @@ const todoApp = new Vue({

31 31

const index = this.todos.indexOf(todo);

32 32

this.todos.splice(index, 1);

33 33

},

34 +

},

35 +

computed: {

36 +

activeTodos() {

37 +

return this.todos.filter(t => !t.isDone);

38 +

}

34 39

}

35 40

});

Original file line number Diff line number Diff line change

@@ -41,9 +41,9 @@ <h1 v-text="title"></h1>

41 41 42 42

<!-- This footer should hidden by default and shown when there are todos -->

43 43

<footer class="footer">

44 -

<!-- This should be `0 items left` by default -->

44 + 45 45

<span class="todo-count">

46 -

<strong>0</strong> item left</span>

46 +

<strong>{{ activeTodos.length }}</strong> item(s) left</span>

47 47 48 48

<!-- Remove this if you don't implement routing -->

49 49

<ul class="filters">

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4