Reputation: 680
I'm working in VS Code on a VueJS 3 project. I have Vetur Extension (version: v0.35.0) installed for error checking and syntax highlighting. I'm getting notified by red tick mark and output in the Problems window about the format of how I'm identifying Object Properties that include a space character in their definition. Here is an example:
this.ncCases = this.store.state.csvJson.data.filter(obj => {
return obj.[`Neighborhood Council`] == this.selectedNC
})
The property "Neighborhood Council" includes a space. I found a reference at mozilla.org that describes enclosing these properties within Square Brackets. However, when I do this, I get the Red Error Market of death.
Identifier expected. Vetur(1003)
Must say the code runs without error so I think the problem is Vetur Extension does not recognize this syntax. Never the less, it would be nice to fix the code to not generate the error or fix Vetur to not display a false positive error.
Any suggestions?
Upvotes: 0
Views: 263
Reputation: 488
this.ncCases = this.store.state.csvJson.data.filter(obj => {
return obj['Neighborhood Council'] == this.selectedNC
})
This should be fine in order to get access to the property
Maybe this response could help you in order to disable some checks here
Upvotes: 2