/*
|
* @Description:
|
* @Version: 2.0
|
* @Autor: wuyun
|
* @Date: 2022-12-05 14:04:33
|
* @LastEditors: wuyun
|
* @LastEditTime: 2023-01-29 16:28:02
|
*/
|
import { App, Directive } from 'vue'
|
|
import * as auth from './modules/permission'
|
import * as tableHeight from './modules/tableHeight'
|
|
const directivesList: any = {
|
tableHeight,
|
auth
|
}
|
|
const directives = {
|
install: function (app: App<Element>) {
|
Object.keys(directivesList).forEach((key) => {
|
//Object.keys() 返回一个数组,值是所有可遍历属性的key名
|
app.directive(key, (directivesList[key] as { [key: string]: Directive })[key]) //key是自定义指令名字;后面应该是自定义指令的值,值类型是string
|
})
|
}
|
}
|
|
export default directives
|