0👍
I assume you are using Vue 2 and Vue-router for routing. In this case you can get current route information via this.$route, for example:
if (this.$route.path == '/page') {
}
this.$route contains the following properties:
{
name: 'Name of the route',
path: '/path/to/route',
params: { /* object with route parameters */ },
query: { /* everything after the question mark in url (example: #/page?id=1&a=b) */}
}
- [Vuejs]-How to access vue component data from socket.io listener function?
- [Vuejs]-Forte Hosted Form callback in vue.js
Source:stackexchange.com