Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
Close bootstrap offcanvas using javascript in vue 3

Not sure why, I need to close offcanvas after the user click on a <router-link> in my vue app.

I've imported the related component in this way

import { Offcanvas } from 'bootstrap/dist/js/bootstrap.esm'

And inside my methods I've created a method that will be called from the router link

        closeOffcanvas() {
            const offcanvasMenu = new Offcanvas(this.$refs.offcanvasNavbar)
            console.log(offcanvasMenu)
            offcanvasMenu.hide()
        },
<li class="nav-item">
<router-link class="nav-link" :to="userProfileURL" @click="closeOffcanvas">Profilo</router-link>
</li>

I've tested the data-bs-dismiss="offcanvas" but this will prevent the navigation to the requested route.

Any suggestion or tip to fix this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!