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