mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-03 12:14:58 +08:00
25 lines
533 B
TypeScript
25 lines
533 B
TypeScript
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)
|
||
}
|
||
|
||
/**
|
||
* 导出指令:v-mountedFocus
|
||
*/
|
||
export const setupMountedFocus = (app: App<Element>) => {
|
||
app.directive('mountedFocus', {
|
||
mounted(el) {
|
||
el.focus()
|
||
}
|
||
})
|
||
}
|