Vue3/Pinia computed from storeToRefs
I have a situation where I need to create a computed property from a pinia store getter - import { computed} from 'vue' import { storeToRefs } from 'pinia' import {useMyStore} from './../stores/mystore' export default { setup() { const { sessionUser } = storeToRefs(useMyStore()) const fullName = computed( () => `${ sessionUser.value.value.firstName } ${ sessionUser.value.value.lastName }` ) return { fullName } } } Obviously the value.value is clunky, and I'd rather not move the computed property down into the store itself. I know why the vale.value is necessary, but is there any better way to
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.