Skip to content

Commit 7118ea2

Browse files
author
Johannes Cleve
authored
docs: Use state instead of this in example (#1295)
Using `state` is the preferred way to access data in a getter. So it's better to use it correctly in examples.
1 parent bfe1707 commit 7118ea2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/docs/core-concepts/getters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ const useCounterStore = defineStore('counterStore', {
184184
counter: 0
185185
}),
186186
getters: {
187-
doubleCounter() {
188-
return this.counter * 2
187+
doubleCounter(state) {
188+
return state.counter * 2
189189
}
190190
}
191191
})

0 commit comments

Comments
 (0)