Merge 9fd5b8a472
into 8312ba1d6c
commit
dfa82062b4
15
src/main.ts
15
src/main.ts
|
@ -1,4 +1,4 @@
|
|||
import {createApp} from 'vue'
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import ElementPlus from 'element-plus'
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
|
@ -9,26 +9,25 @@ import { usePermissStore } from './store/permiss'
|
|||
import 'element-plus/dist/index.css'
|
||||
import './assets/css/icon.css'
|
||||
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(ElementPlus, {
|
||||
locale: zhCn,
|
||||
locale: zhCn,
|
||||
})
|
||||
// 注册elementplus图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component)
|
||||
app.component(key, component)
|
||||
}
|
||||
// 自定义权限指令
|
||||
const permiss = usePermissStore()
|
||||
app.directive('permiss', {
|
||||
mounted(el, binding) {
|
||||
if(!permiss.key.includes(String(binding.value))){
|
||||
el['hidden'] = true;
|
||||
}
|
||||
mounted(el, binding) {
|
||||
if (!permiss.key.includes(String(binding.value))) {
|
||||
el['hidden'] = true
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
app.mount('#app')
|
Loading…
Reference in New Issue