please someone help.
let cityObj = Object.values(data).map(city => {
return { id: parseInt(city.id), name: city.topic };
});
this.cities = [{id: 0, name: 'England' },...cityObj];
I am trying to update cities after request to server. in console.log it shows that cities is changed but in site no changes. What i am doing wrong?
without ref i couldnt get selected value maybe it is because i am using vue cdn.
<select ref="mySelect" v-model="selectedCity">
<option v-for="city in cities" :value="city.id" :id="city.id" :selected="city.id == selectedCity">{{ city.name }}</option>
</select>
tried with set this.$set(this.cities, index, cityObj);
but still nothing