refactor: Integrate the @vben-core/shared package

This commit is contained in:
vben
2024-07-30 21:05:03 +08:00
parent e6403868fc
commit cf0ec053e4
223 changed files with 330 additions and 328 deletions

View File

@@ -16,7 +16,9 @@ function isAccessible(el: Element, binding: any) {
return;
}
const authMethod =
accessMode.value === 'frontend' ? hasAccessByRoles : hasAccessByCodes;
accessMode.value === 'frontend' && binding.arg === 'role'
? hasAccessByRoles
: hasAccessByCodes;
if (!authMethod(value)) {
el?.remove();
@@ -31,8 +33,6 @@ const authDirective: Directive = {
mounted,
};
export function installAccessDirective(app: App) {
export function useAccessDirective(app: App) {
app.directive('access', authDirective);
}
export default authDirective;