Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to activated item on certain url #34

Open
sinau123 opened this issue Feb 28, 2019 · 1 comment
Open

Add option to activated item on certain url #34

sinau123 opened this issue Feb 28, 2019 · 1 comment
Assignees

Comments

@sinau123
Copy link

It will be great if we can add option to activate item that match with certain URL that not define in list of item 'name' props

the default:

  export default {
    data() {
      return {
        items: [
          { name: 'Products', 
             children: [
                { 
                    name: 'Shoes', 
                    path: 'shoes' ,
                 }
             ]
          },
        ],
      };
    },
  };

what if we want 'Shoes' item active if current URL is eg('shoes/detail/1358993' or '/shoes/popular'), maybe with settings like this:

  export default {
    data() {
      return {
        items: [
          { name: 'Products', 
             children: [
                { 
                    name: 'Shoes', 
                    path: 'shoes' ,
                    otherPaths:[
                        'shoes/detail/[\\d]{1,20}', //using regex
                        'shoes/popular',
                    ],
                 }
             ]
          },
        ],
      };
    },
  };
@MisRob
Copy link
Collaborator

MisRob commented Mar 1, 2019

Hi, something like that is quite easy to add and might be useful, I've just labeled is as a feature request.

@chellem chellem self-assigned this Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants