We're currently converting from boilerplate VUE 2 to Composition API, and i'm struggling to understand how to rewrite our current computed to support Composition API :
setup() {
const store = useStore<StoreState>();
// Question : how do i implement the infoFields into the setup ?
// const contactSingle = computed(() => store.state.contacts.contactSingle);
return { contactSingle };
},
computed: {
...mapGetters("contacts", ["getContact"]),
infoFields(): any {
return [
{
value: (this as any).getContact.customer.firstName,
label: "Fornavn",
},
{
value: (this as any).getContact.customer.lastName,
label: "Etternavn",
},
...
...
];
},
<v-row>
<v-col class="pt-0" v-for="(item, i) in infoFields" :key="i + '-field'" cols="12" xs="12" sm="6" md="6" lg="4">
<BaseSheetField :value="item.value" :label="item.label" />
</v-col>
</v-row>
databecomesreforreactive. By using a computed insidedatayou've lost reactivity. Is this intentional?