Open side nav manually
clien007 opened this issue · 1 comments
clien007 commented
Hi!
Just want to ask how to open the side nav manually or using javascript?
Thanks!
BobSynfig commented
Hi,
You can use a reactive variable like here:
<Slide :isOpen=slideIsOpen @openMenu=openSlide @closeMenu=closeSlide></Slide>
data() {
return {
slideIsOpen : false //Closed at startup
}
}
methods: {
openSlide() {
this.slideIsOpen = true
} ,
closeSlide() {
this.slideIsOpen = false
},
toggleSlide() {
this.slideIsOpen = !this.slideIsOpen
}
}
and call the wanted method (this.openSlide(), this.closeSlide() or this.toggleSlide()) from your code :)