]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: note about v-model in state
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 5 Aug 2025 15:52:15 +0000 (17:52 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 5 Aug 2025 15:52:15 +0000 (17:52 +0200)
packages/docs/core-concepts/state.md

index 4421f770ccc946fcca2e7776132f166a2c9fe2d3..0d84574856c16d52f371de8a08537dbdc2aee7f5 100644 (file)
@@ -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
+<input v-model="store.count" type="number" />
+```
+
+::: 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