简体   繁体   English

是否可以使用 Vue-router 将屏幕加载到选项卡中?

[英]Is it possible to load screen into Tabs using Vue-router?

I have a setup where I have a routes file and multiple routes setup eg: localhost:8000/test & localhost:8000/test2我有一个设置,其中有一个路由文件和多个路由设置,例如: localhost:8000/test & localhost:8000/test2

My goal is to have a final route for example localhost:8000/tabs where I use some sort of Tab import for example bootstrap or Vuetify to crease tabs for each route within the page.我的目标是有一个最终路线,例如localhost:8000/tabs ,我使用某种选项卡导入(例如 bootstrap 或 Vuetify)为页面中的每条路线创建选项卡。

For example: localhost:8000/tabs?=test&test2 would render a page where the components test and test2 are the tab items.例如: localhost:8000/tabs?=test&test2将呈现一个页面,其中组件 test 和 test2 是选项卡项。 (Components themselves Dynamically retrieved using the routes file?). (组件本身使用路由文件动态检索?)。

The main problem with routes I am facing is that it reloads the page/changes the URL of the page instead of staying within localhost:8000/tabs .我面临的路线的主要问题是它重新加载页面/更改页面的 URL 而不是停留在localhost:8000/tabs内。

Thanks for any advice.感谢您的任何建议。

Yes, you can using the <router-view /> and child routes.是的,您可以使用<router-view />child路由。

Read more here在这里阅读更多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM