How listen to the changes of route link in inertia js? #624
Replies: 3 comments 2 replies
-
@jeanali If using Ziggy, are you sure it's |
Beta Was this translation helpful? Give feedback.
-
The issue seems to be that both To fix this issue I added a <script>
export default {
data() {
return {
active: this.isCurrent(),
}
},
methods: {
isCurrent() {
return this.route().current(this.href) // custom prop from a parent component
},
},
computed: {
url() {
return this.$page.url
},
},
watch: {
url() {
this.active = this.isCurrent()
},
},
}
</script> There might be a better way to do it but it works. |
Beta Was this translation helpful? Give feedback.
-
I was having this issue with inertia 1.0 and Vue3 with
The confusion I had faced was setting a constant like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have these links:
The span is vertical line to just the route is active.
The problem is that when switch between routes the active does not work unless I refresh the page! How can check if the route shows the line and when I go to another one hide previous one ?
Beta Was this translation helpful? Give feedback.
All reactions