I have got this in my html code
<div class="pl_wrapper">
<div class="options_pl">
<input type="button" @click="optionButtonClicked" class="option_button_pl" value="List">
<input type="button" @click="optionButtonClicked" class="option_button_pl" value="Add a language">
</div>
{{show2}}
</div>
And this in my vue.js
const ProgrammingLanguages = new Vue({
el:".pl_wrapper",
data:{
name: "aa",
show1: false,
show2: false
},
methods: {
optionButtonClicked(){
var indexOfClicked = index(event.target,event.target.className);
var equalIndexOfDiv = getOnIndex(indexOfClicked,"pl_divs")
$(".options_pl").hide();
show1 = (indexOfClicked==0) ? true : false
show2 = (indexOfClicked==1) ? true : false
}
}
});
Now when i click option_button_pl i expect {{show2}}'s to also change from false to true and vice versa.But alas that doesn't Jsfiddle: happen.https://jsfiddle.net/3akfzcyf/
this.show1,this.show2, etc. I'd read through the docs: vuejs.org/v2/guide