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

Absolute paths #33

Open
grphapp opened this issue Jan 17, 2019 · 5 comments
Open

Absolute paths #33

grphapp opened this issue Jan 17, 2019 · 5 comments
Assignees

Comments

@grphapp
Copy link

grphapp commented Jan 17, 2019

How can I specify that paths are absolute and not relative vue-router paths when programmatically generating the items?

@MisRob
Copy link
Collaborator

MisRob commented Jan 17, 2019

Hello,

you can use external instead of relative path, this behaviour is described https://misrob.github.io/vue-tree-navigation/#/usage#items and there's an example here https://misrob.github.io/vue-tree-navigation/#/examples/manual

When thinking about it, it might be better to call this field simply absolute instead of external. Maybe in some next major release :)

@grphapp
Copy link
Author

grphapp commented Jan 17, 2019

Yeah so that doesn't help if you're trying to link to absolute vue-router paths. With relative paths, it just appends which isn't helpful if your routes are not in the same tree structure.

@MisRob
Copy link
Collaborator

MisRob commented Jan 17, 2019

Oh yes, I get what you mean now. The library is currently built on working with the tree structure but I've been already thinking about adding support for route's config objects to add more flexibility and especially support for named paths (for example you could use { name: 'my-route-name' } in vue-tree-navigation path field). This requires core changes so I cannot say when it will be done. I need to think more about spec in detail and then I'll open a new feature issue. I'll also take your use-case in account. Thank you!

@grphapp
Copy link
Author

grphapp commented Jan 17, 2019 via email

@MisRob
Copy link
Collaborator

MisRob commented Jan 18, 2019

Sure, in what form would you like to do that? There're two ways:

  1. Become a contributor (help is welcome!) - in that case we would need to discuss specification in detail. Technically, it's nothing difficult to do, but after switch to paths independent of menu tree structure for more flexibility I would like to provide backwards compatibility for folks who rely on the way paths work right now probably (adding config object to plugin with something like appendPath might be an option - need to think about that more)
  2. In case you're not interested in contributing, you can always copy the library, study core.js and its specs and modify the behaviour there. getItemMetadata function is the most important for you. Basically you can get rid of all functionality related to appending relative paths and simply use path as a target directly. It should be quite easy to do.

@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