P
P
postya2020-10-06 13:12:45
Vue.js
postya, 2020-10-06 13:12:45

How to get current route in nuxt?

There is an h1 tag in which you want to display the current route.

How to get this route?

What I have at the moment:

The component in which I need to display the current route:
5f7c425782fe3755256653.jpeg

I have playlists-playlist displayed. I
need to display Playlist 123123

5f7c42ac49db3360908742.jpeg
5f7c42ca285b9920069959.jpeg

I get the route like this:

<h2>Плейлист {{playlistName}}</h2>

data: () => ({
    playlistName: '',
}),
mounted() {
    this.playlistName = $nuxt.$route.name;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2020-10-06
@postya

this.$route.params.playlist

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question