[Vuejs]-Typescript typing error while catching data from pinia state to the template

0👍

You are not returning the "storeForm" object from your setup function.

Recommendations: to make your data reactive you should use the following syntax, as docs suggest.

https://pinia.vuejs.org/core-concepts/

<script setup>
import { storeToRefs } from 'pinia'

const store = useCounterStore()
// `name` and `doubleCount` are reactive refs
// This will also extract refs for properties added by plugins
// but skip any action or non reactive (non ref/reactive) property
const { name, doubleCount } = storeToRefs(store)
// the increment action can just be destructured
const { increment } = store
</script>

Leave a comment