two-way binding, v-model, and form handling #854
-
Regarding the Vuex documentation on Form Handling , does Pinia change this in any way? Right now under Vuex, I rely pretty heavily on vuex-map-fields to handle this (form fields in the store) and avoid extensive two-way computed properties. If I want to migrate to Pinia, what is the recommended way to handle this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
In pinia you don't need any extra lib: const useStore = defineStore(id, { state: () => ({ name: '' }) })
const store = useStore() <input v-model="store.name"> |
Beta Was this translation helpful? Give feedback.
-
Is this the same case using the "options" api, where "mapState" is being used? Edit: use |
Beta Was this translation helpful? Give feedback.
In pinia you don't need any extra lib: