Visual Studio Code "false" Parsing error problem - calling an object's property starting with a number

215 Views Asked by At

I'm currently working on a small project using Visual Studio Code as a code editor to connect to an API using axios with Vue.js.

My issue is that I need to access a property in one of the API's objects that starts with a number: "24hVolume". Since I was getting an error when using it I found out that I could call it using square brackets as :

<p>{{ parseFloat(detail.["24hVolume"]).toLocaleString() }}</p>

It's now working perfectly but VS Code is telling me there's an error in my code and can't find out how to whether ignore it or make it go away. Here's the error :

[vue/no-parsing-error] Parsing error: Unexpected token [.

Thanks in advance for the help, this red warning is driving me nuts !

0

There are 0 best solutions below