[Vuejs]-Vue mutation type intellisense VS Code

2👍

Isn’t this wrong and throwing syntax errors?

It should be:

export default {
  MY_MUTATION_TYPE: 'MY_MUTATION_TYPE',
  ANOTHER_MUTATION_TYPE: 'ANOTHER_MUTATION_TYPE',
}

That would make auto complete work.

0👍

Since you are doing default export, in your import you also should use default import syntax. In your case mutationTypes can be any name, so that’s why autocomplete will not work in the import. It will work on the object itself though:

enter image description here

To make it work in imports, you should use named exports.

Leave a comment