creativetimofficial/ct-vue-material-dashboard-pro

[Bug] Active Nested Route

subhanshu-shukla opened this issue · 1 comments

Version

latest

Reproduction link

http://na/com

Operating System

windows

Device

laptop

Browser & Version

mozilla

Steps to reproduce

Create nested route like senders/sender

What is expected?

Senders link in side bar should be active

What is actually happening?

Senders link in side bar is not active


Solution

Additional comments

isActive() {
  if (this.$route && this.$route.path) {
    let matchingRoute = this.children.find(c =>
      this.$route.path.startsWith(c.link.path)
    );
    if (matchingRoute !== undefined) {
      console.log(matchingRoute);

      return true;
    }
  }
  return false;
}

When i clicked senders route is /senders
and sender is green now
image
When I clicked +Request route is senders/sender
But sender is not green
image