amirkian007 / vue-awesome-sidebar

A Modern and Fast sidebar Menu component for vue(3x) capable with vue-router.
https://amirkian007.github.io/vasmenu/
MIT License
52 stars 14 forks source link

Router mode should use vue-router #5

Open zsh2401 opened 1 year ago

zsh2401 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

zsh2401 commented 1 year ago

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 commented 1 year ago

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

amirkian007 commented 1 year ago

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 commented 1 year ago

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!