Closed shailen-naidoo closed 5 years ago
This is because return type of mapXXX
is just a record type. You need to cast it by yourself currently.
...mapMutation({
addCustomItem: 'form/ADD_CUSTOM_ITEM'
}) as {
addCustomItem: (payload: any) => void
}
Closing as this is Vuex problem rather than Vetur.
Thanks
On Tue, 30 Jul 2019, 08:11 katashin, notifications@github.com wrote:
Closed #1346 https://github.com/vuejs/vetur/issues/1346.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vuejs/vetur/issues/1346?email_source=notifications&email_token=AGKSRXEOJJZCH24FNPZS7RLQB7LRDA5CNFSM4H46QXJKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSYPSSGY#event-2518624539, or mute the thread https://github.com/notifications/unsubscribe-auth/AGKSRXHOASZYHG2PAGOP4HLQB7LRDANCNFSM4H46QXJA .
Info
Problem
I am getting this weird error I am using
mapState
to bindcustomItems
property to my component from vuex. I am spreadingmapState
into thecomputed
property. When i usecustomItems
anywhere in the component, Vetur thinks thatcustomItems
is oftype MutationMethod
Here is the component:
Here is the error:
Reproducible Case
mapState
to bind a property from Vuex to the component