[Vuejs]-What is the best way to specify data with brackets in Vuejs?

0👍

As par you code, you have to do:

mapping['map']['email_address']['type']

or

mapping.map.email_address.type

0👍

You should rethink your data to not have so many nested objects.

If you are setting a property directly within an object, it is good practice to use Vue.set to ensure you do not break reactivity. Doing this will save you hours of headaches trying to figure out where something broke.

Vue.set(mapping.map.email_address, 'type', value_to_set)

Leave a comment