From: Eduardo San Martin Morote Date: Tue, 5 Aug 2025 15:52:15 +0000 (+0200) Subject: docs: note about v-model in state X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe6d61a3aadc5822a8ca4388748ea10489bdc1b1;p=thirdparty%2Fvuejs%2Fpinia.git docs: note about v-model in state --- diff --git a/packages/docs/core-concepts/state.md b/packages/docs/core-concepts/state.md index 4421f770..0d845748 100644 --- a/packages/docs/core-concepts/state.md +++ b/packages/docs/core-concepts/state.md @@ -87,13 +87,23 @@ interface UserInfo { By default, you can directly read from and write to the state by accessing it through the `store` instance: -```js +```ts const store = useStore() store.count++ ``` -Note you cannot add a new state property **if you don't define it in `state()`**. It must contain the initial state. e.g.: we can't do `store.secondCount = 2` if `secondCount` is not defined in `state()`. +Yes, this means **no verbose wrappers** like in Vuex, you can directly bind that to `v-model`: + +```vue-html + +``` + +::: info + +You cannot add a new state property **if you don't define it in `state()`**. It must contain the initial state. e.g.: we can't do `store.secondCount = 2` if `secondCount` is not defined in `state()`. + +::: ## Resetting the state