[Vuejs]-Unable to set nested object value in vuex state completely

0👍

What do you see if you console.log(item.tour_location); within the setItem mutation? If the data is coming in with the correct structure, I would recommend setting up your state as a skeleton of the expected data.

For example:

Expected data: {id: 'abc', hotel: [{ prop1: '123', prop2: '234']}

Vuex state: {id: '', hotel: [{ prop1: '', prop2: '' }]}

Hope this helps.

Leave a comment