[Vuejs]-Interpolation doesn't rerender in parent component after custom event from child

0๐Ÿ‘

โœ…

I found solution in Vue docs:

Due to limitations in JavaScript, Vue cannot detect the following changes to an array:
When you directly set an item with the index, e.g. vm.items[indexOfItem] = newValue

I was doing exacly like above.

The solution is instead

this.selectedLanguages[res.key] = res.value;

use

this.$set(this.selectedLanguages, res.key, res.value);

which is basically a bit weird but it works.

Leave a comment