This is weird, but it is the first time I have dealt with JSON in Vue3, and it doesn’t seem to be reacting as I expected.
I have some JSON in a Vue DataObject called dataObject
data() {
return {
dataObject: {}
}
},
My JSON data looks, something, like this,
{
"myDataList": [
{
"list_item_1_1": "1234",
"list_item_1_2": "2023-09-21T09:06:13.000Z",
...
"list_item_1_6": [
{
"inline_list_item_1_6_1": "ABCD",
...
}
],
},
{
"list_item_2_1": "EFGH",
"list_item_2_2": "5678",
"list_item_2_3": "IJKL",
...
"list_item_2_8": {
"list_item_2_8_1": "OK",
"list_item_2_8_2": "MAYBE",
"list_item_2_8_3": "9011"
},
},
{
...
}
]
}
Now for some reason I can’t reach into the data and pull out, for example, list_item_2_8
. As this is Vue I am using <p>Data Value: {{this.dataObject.1.list_item_2_8}</p>
, however this gives me an Unexpected token
error in the console. When I run this through a JSON tool, this configuration of JSON is valid…
StackOverflow, Google, JSONFormatter.org and JSONQueryTool.com
Could someone point me in the right direction please? What am I doing wrong?