Need help regarding router

Hello there!
can anyone tell me how can we get previous url in vue component?
i am trying to get previous page url when every user performs any activity.

Haven’t really tested this but I guess you can pop the state from router or you can use Vuex for that.

Maybe this link will help you out.

hello @ktopouzi, thanks for your response.
i want only url of the previous page is it not possible without installing any additional packges?

Hi @mohit.dhanvani
You can use below code to get previous link

beforeRouteEnter(to, from, next) {
  next(vm => {
    vm.prevRoute = from
  })
}, 

Then you can use this.prevRoute.path to get the previous URL.