[Vuejs]-Accordion plus and minus icon not changing

0πŸ‘

βœ…

The b-collapse events include show and hide, which is emitted when the component state changes. Thus, you could use a v-on directive (or @ for shortand) to bind an event listener in the template that sets the isActive flag accordingly:

<b-collapse @hide="isActive = false" @show="isActive = true">

Then you could remove the button-click handler as it’s already taken care of by the event binding above.

demo

πŸ‘€tony19

-1πŸ‘

Your data is defined like method, try to do it in more clear way:

{
    data: () => ({
        isActive: false
    })
}
πŸ‘€Asimple

Leave a comment