0👍
To use dispatch
with parameters you can simply:
this.$store.dispatch("uploadCourseResourceFile", {publicKey: this.$route.params.id, file})
And you can access your data from uploadCourseResourceFile
just like you are doing.
Your const data
does not make much sense in this case. Accessing this.file
in this context you are showing will not return what you want.
Source:stackexchange.com