Struggling to successfully iterate over an external JSON file in Vue.
The file is imported like this:
import json from '../../public/platform.json'
export default {
data: () => ({
currentPage: 0,
brand: '',
platform: '',
affiliate: '',
myJson: json,
}),
This is how the JSON file is structured:
{
"Example": {
"Username": "",
"Password": "",
"AffiliateID": "",
"GI": "",
"CI": "",
"freeTextArea": ""
},
"ExampleTwo": {
"Username": "",
"Password": "",
"freeTextArea": ""
}
}
My objective is as follows: I need to check if the "platform" from the data matches either "Example" or "ExampleTwo", and if it does, I want to access the fields within each of them.
How can I achieve this?