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

请问路由元信息如何扩展? #16

Closed
WT-SML opened this issue Mar 31, 2022 · 3 comments
Closed

请问路由元信息如何扩展? #16

WT-SML opened this issue Mar 31, 2022 · 3 comments
Assignees
Labels

Comments

@WT-SML
Copy link

WT-SML commented Mar 31, 2022

本项目是基于文件路由的。
那么如果某些路由需要携带重要的 meta 信息(权限),标准做法是什么?
是 vite-plugin-pages插件的 extendRoute ?
还是重写路由文件?

@hotuns
Copy link

hotuns commented Mar 31, 2022

<route lang="yaml">
meta:
  title: 首页
  isMenu: true
  icon: mdi:home
  role: [admin]
</route>

我是这样写的,之后可以在页面里拿到这个meta信息。
具体可以参考一下我基于这个项目开发的一个简单的admin框架
https://github.com/hedongshu/vitesse-with-naive

@WT-SML
Copy link
Author

WT-SML commented Mar 31, 2022

感谢解答!Thanks♪(・ω・)ノ

@markthree markthree self-assigned this Mar 31, 2022
@markthree
Copy link
Member

@WT-SML 靓仔你好,具体用法也可见 vite-plugin-pages

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

No branches or pull requests

3 participants