close other open toggle in vue

js and how to do below things

Screenshot

now my problem is that if I click on product and after that I click on setting then both are open, but I want to open only preset clicked toggle.

For example, if I click on setting then setting should be open now after that if I click on product then setting should be close and product toggle should open.

How I can do that?

here is my code, which I use to open on click:

<script>
export default {

    methods: {
       handleClick (e) {
           e.preventDefault()
           e.target.parentElement.classList.toggle('open')
             }
          }
       }
  </script>

1 answer

  • answered 2018-04-17 08:05 Dmitriy Panov

    You must remove open class for all links after clicking on another link