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.
π€tony19
-1π
Your data is defined like method, try to do it in more clear way:
{
data: () => ({
isActive: false
})
}
π€Asimple
Source:stackexchange.com