Does anyone know if there is a simple method of closing the Boostrap-VueJS toggle navbar when clicking outside?
I've tried multiple directive codes, tried the vue-click-outside plugin, and many different examples but without luck. It seems that when I try to bypass the vue bootstrap component, the hamburger toggle button stops working.
Here is my code:
<b-navbar toggleable="lg" fixed="top">
<b-navbar-brand class="header-name" :to="{name: 'homeLink'}">Test</b-navbar-brand>
<b-navbar-toggle class="custom-toggler" target="nav-collapse"></b-navbar-toggle>
<b-collapse id="nav-collapse" is-nav>
<!-- Right aligned nav items -->
<b-navbar-nav class="ml-auto" >
<b-nav-form>
</b-nav-form>
<b-nav-item :to="{name: 'homeLink'}">Home</b-nav-item>
<b-nav-item :to="{name: 'test1'}">test</b-nav-item>
<b-nav-item :to="{name: 'test2'}" >test</b-nav-item>
<b-nav-item :to="{name: 'test3'}" >test</b-nav-item>
<b-nav-item :to="{name: 'test4'}" >test</b-nav-item>
</b-navbar-nav>
</b-collapse>
</b-navbar>