[Vuejs]-No reaction on click event listener

3👍

Your Vue instance only controls the div (id=content), you need to wrap the ul into an element that Vue controls too:

<div id="app">
<ul class="navbar-nav">
   <li class="nav-item">
       <a class="nav-link" href="#" @click="reverseService">Services</a>
   </li>
</ul>

<div :class="{{ isService? '':'section' }}">
   <div class="row" v-if="!isService">
    some content
   </div>
   <div v-else>
    other content 
   </div>
</div>
</div>

In your script:

new Vue({
    el: '#app',
👤Psidom

Leave a comment