ipms-sjy-ui/src/directives/index.ts

25 lines
533 B
TypeScript
Raw Normal View History

import type { App } from 'vue'
import { hasRole } from './permission/hasRole'
import { hasPermi } from './permission/hasPermi'
/**
* v-xxx
* @methods hasRole 用法: v-hasRole
* @methods hasPermi 用法: v-hasPermi
*/
export const setupAuth = (app: App<Element>) => {
hasRole(app)
hasPermi(app)
}
/**
2024-04-18 15:56:49 +08:00
* v-mountedFocus
*/
2024-04-18 15:56:49 +08:00
export const setupMountedFocus = (app: App<Element>) => {
app.directive('mountedFocus', {
mounted(el) {
el.focus()
}
})
}