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

Router mode should use vue-router #5

Open
zsh2401 opened this issue Jan 4, 2023 · 6 comments
Open

Router mode should use vue-router #5

zsh2401 opened this issue Jan 4, 2023 · 6 comments

Comments

@zsh2401
Copy link

zsh2401 commented Jan 4, 2023

I have read a tiny part of source of this project, then I found that it seems to just change hash to route. I suggest that use the useRouter to get the router instance and call router.push, so that this library can adapt to more routing methods such as memory and non-hash

@amirkian007
Copy link
Owner

hi @zsh2401 thanks for opening the issue.
using useRouter requires vue-router to be added as a dependency , this means user has to install an extra dependency even if not using vue-router at all.
which i don't think is ideal since this library is made with 0 dependencies .
I think the better method is to disable default vue-router functionality with vueRouterEnabel="false" and handle routing with event listener like @item-click(MenuItem) , which i think is the better approach. slots is another Alternative. whats your opinion?

@zsh2401
Copy link
Author

zsh2401 commented Jan 6, 2023

I thought we can add vue-router as peer dependency and dynamically check whether users have installed it.

@zsh2401
Copy link
Author

zsh2401 commented Jan 6, 2023

Other component libraries that contains sidebar component and provide router mode all uses the vue-router. They consider users who is enabling router mode must installed the vue-router

@zsh2401
Copy link
Author

zsh2401 commented Jan 6, 2023

Thank you for your jobs, again! Your library has been imported to a business project in my company.

@amirkian007
Copy link
Owner

Other component libraries that contains sidebar component and provide router mode all uses the vue-router. They consider users who is enabling router mode must installed the vue-router

Yeah I need to check them out and figure out a solution when I have the time

@amirkian007
Copy link
Owner

Thank you for your jobs, again! Your library has been imported to a business project in my company.

I Am very HAPPY to hear that :))) !!!
Thanks again for using this library and I will keep improving and adding new futures to this library soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants