From fe6d61a3aadc5822a8ca4388748ea10489bdc1b1 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 5 Aug 2025 17:52:15 +0200 Subject: [PATCH] docs: note about v-model in state --- packages/docs/core-concepts/state.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 -- 2.47.3