提交 | 用户 | 时间
|
820397
|
1 |
import type { App } from 'vue' |
H |
2 |
import { hasRole } from './permission/hasRole' |
|
3 |
import { hasPermi } from './permission/hasPermi' |
|
4 |
|
|
5 |
/** |
|
6 |
* 导出指令:v-xxx |
|
7 |
* @methods hasRole 用户权限,用法: v-hasRole |
|
8 |
* @methods hasPermi 按钮权限,用法: v-hasPermi |
|
9 |
*/ |
|
10 |
export const setupAuth = (app: App<Element>) => { |
|
11 |
hasRole(app) |
|
12 |
hasPermi(app) |
|
13 |
} |
9259c2
|
14 |
|
H |
15 |
/** |
|
16 |
* 导出指令:v-mountedFocus |
|
17 |
*/ |
|
18 |
export const setupMountedFocus = (app: App<Element>) => { |
|
19 |
app.directive('mountedFocus', { |
|
20 |
mounted(el) { |
|
21 |
el.focus() |
|
22 |
} |
|
23 |
}) |
|
24 |
} |