It is strange. I am trying to trigger a method when an element is clicked in the v-for loop. But it does not work when I use v-if or v-show. This is my HTML code sample;
<div class="chosen-drop custom_choices" v-if="showResults"> <!-- -->
<ul class="chosen-results">
<li class="active-result level-0 isresult" v-for="City in Results" v-bind:class="{ highlighted: SelectCity.name==City.name }" v-on:click="HandleSelectCity(City)" >{{ City.name }}</li>
</ul>
</div>
This is my method;
methods: {
HandleSelectCity: function (City){
this.SelectCity = City;
this.search_input = City.name;
}
},
I am using Vuejs 1.0.8