I'm new in vuejs, I want to show tab data from from sibling component, below is my code. Please help!!
I could toggle the tab but unable to show data from sibling component
`
<template>
<div>
<section>
<div>logo</div>
<tabs></tabs>
<div>right menu</div>
</section>
<tabs-data></tabs-data>
</div>
</template>
<script>
export default {
components: {
'tabs': {
template: '<div><a href="#" v-on:click="checkClass()" v-bind:class="{ active: ist1 }">tab1</a><a href="#" v-on:click="checkClass()" v-bind:class="{ active: ist2 }">tab2</a></div>',
data () {
return {
ist1: true,
ist2: false
}
},
methods: {
checkClass: function () {
this.ist1 = !this.ist1
this.ist2 = !this.ist2
}
}
},
'tabs-data': {
template: '<section><p v-if="ist1">Tab Data 1</p><p v-else>Tab Data 2</p></section>'
}
}
}
</script>
`