feat(directive): 添加自定义指令directive实现按钮权限控制
This commit is contained in:
14
src/main.ts
14
src/main.ts
@@ -1,4 +1,4 @@
|
||||
import {createApp} from 'vue'
|
||||
import {createApp, Directive} from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from "./router";
|
||||
import '@/styles/index.scss'
|
||||
@@ -8,20 +8,22 @@ import 'element-plus/theme-chalk/index.css'
|
||||
import locale from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import 'virtual:svg-icons-register';
|
||||
|
||||
|
||||
// @see https://blog.csdn.net/qq_37213281/article/details/121422027
|
||||
import * as ElIconModules from '@element-plus/icons'
|
||||
import '@/permission'
|
||||
|
||||
|
||||
import Pagination from '@/components/Pagination/index.vue'
|
||||
import {listDictsByCode} from '@/api/system/dict'
|
||||
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
// 统一注册el-icon图标
|
||||
// @link https://blog.csdn.net/Alloom/article/details/119415984
|
||||
// 自定义指令
|
||||
import * as directive from "@/directive";
|
||||
Object.keys(directive).forEach(key => {
|
||||
app.directive(key, (directive as { [key: string]: Directive })[key]);
|
||||
});
|
||||
|
||||
// 统一注册el-icon图标 https://blog.csdn.net/Alloom/article/details/119415984
|
||||
for (let iconName in ElIconModules) {
|
||||
app.component(iconName, (ElIconModules as any)[iconName])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user