I trying to toggle state when I click on particular element
<script>
import ArrowSwitcher from '@/components/ui/ArrowSwitcher.vue'
export default {
components: {
ArrowSwitcher
},
data () {
return {
showContent: false
}
},
methods: {
switcher () {
this.showContent = !this.showContent
}
}
}
</script>
<span class='targeting-global__name' @click='switcher'>
Some Text
<ArrowSwitcher :showContent='showContent'/>
</span>
When I stick event on parent element (just html, not other component) it works
Surprisingly this approach not changing state at all! Why?
<span class='targeting-global__name'>
Targeting Global
<ArrowSwitcher :showContent='showContent' @click='switcher'/>
</span>
I want to stick click event only to Arrow switcher component instead of whole text