feat(projects): 新增静态路由

This commit is contained in:
Soybean
2022-03-30 01:19:37 +08:00
parent bbfdcc8276
commit ca2dfa6185
34 changed files with 1591 additions and 1875 deletions

View File

@@ -0,0 +1,16 @@
import type { App, Directive } from 'vue';
import { useAuthStore } from '@/store';
export default function setupLoginDirective(app: App) {
const auth = useAuthStore();
const loginDirective: Directive<HTMLElement, Auth.RoleType | undefined> = {
mounted(el: HTMLElement, binding) {
if (binding.value !== auth.userInfo.userRole) {
el.remove();
}
},
};
app.directive('login', loginDirective);
}