refactor: 全局注册自定义指令方式优化
Former-commit-id: 40c40fa90d88d9efad4ef2fb73b00d650427fd05
This commit is contained in:
@@ -1 +1,9 @@
|
||||
export { hasPerm, hasRole } from './permission';
|
||||
import type { App } from 'vue';
|
||||
|
||||
import { hasPerm } from './permission';
|
||||
|
||||
// 全局注册 directive
|
||||
export function setupDirective(app: App<Element>) {
|
||||
// 使 v-hasPerm 在所有组件中都可用
|
||||
app.directive('hasPerm', hasPerm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user