From: Johannes Cleve <36301325+JohannesCleve@users.noreply.github.com> Date: Sun, 15 May 2022 09:20:34 +0000 (+0200) Subject: docs: Use `state` instead of `this` in example (#1295) X-Git-Tag: @pinia/nuxt@0.2.0~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7118ea2da85de5281c2446243096aab2d5547c2c;p=thirdparty%2Fvuejs%2Fpinia.git 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. --- diff --git a/packages/docs/core-concepts/getters.md b/packages/docs/core-concepts/getters.md index c940f5f6..2c0e6016 100644 --- a/packages/docs/core-concepts/getters.md +++ b/packages/docs/core-concepts/getters.md @@ -184,8 +184,8 @@ const useCounterStore = defineStore('counterStore', { counter: 0 }), getters: { - doubleCounter() { - return this.counter * 2 + doubleCounter(state) { + return state.counter * 2 } } })