[Vuejs]-Vuejs – how to get the path of a route by its name?

1👍

You should be able to use the router.resolve method to retrieve the href for a given route. I’m not sure how this handles the params.

computed: {
    href() {
        return this.$router.resolve({
            name:'recipe_article',
            params: {
                slug: this.featured[0].slug
            }
        }).href
    }

}

Leave a comment