From: Danny Feliz Date: Wed, 31 Mar 2021 07:41:37 +0000 (-0400) Subject: docs: fix todo example (#413) X-Git-Tag: v2.0.0-alpha.9~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee4e2cd3441e2d800b50900ae630c26477d4712a;p=thirdparty%2Fvuejs%2Fpinia.git docs: fix todo example (#413) --- diff --git a/docs/introduction.md b/docs/introduction.md index 72cb07e1..d9f5a70f 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -67,9 +67,9 @@ export const todos = defineStore({ filteredTodos() { if (this.filter === 'finished') { // call other getters with autocompletion ✨ - return this.finishedTodos() + return this.finishedTodos } else if (this.filter === 'unfinished') { - return this.unfinishedTodos() + return this.unfinishedTodos } return this.todos }, @@ -78,7 +78,7 @@ export const todos = defineStore({ // any amount of arguments, return a promise or not addTodo(text) { // you can directly mutate the state - this.todos.push({ text, id: nextId++, isFinished: false }) + this.todos.push({ text, id: this.nextId++, isFinished: false }) }, }, })