[Vuejs]-How to show a text based on the current url?

0👍

You can access any of your route params by define a slug. so you route will be something like this:

router.map({
    '/:slug/subsectionA': {
        component: your_component,
        name: 'section'
    },
})

then you can access the :slug dynamic slot in your view like this:

this.$route.params.slug  

Leave a comment