diff --git a/vue-admin-wonderful-next/package.json b/vue-admin-wonderful-next/package.json index bed7864..0e5b3db 100644 --- a/vue-admin-wonderful-next/package.json +++ b/vue-admin-wonderful-next/package.json @@ -7,6 +7,7 @@ }, "dependencies": { "element-plus": "^v1.0.1-beta.19", + "mitt": "^2.1.0", "sortablejs": "^1.10.2", "vue": "^3.0.5", "vue-router": "^4.0.2" @@ -19,4 +20,4 @@ "typescript": "^4.1.2", "vite": "^1.0.0-rc.13" } -} \ No newline at end of file +} diff --git a/vue-admin-wonderful-next/src/main.ts b/vue-admin-wonderful-next/src/main.ts index e340a98..25e9c42 100644 --- a/vue-admin-wonderful-next/src/main.ts +++ b/vue-admin-wonderful-next/src/main.ts @@ -6,5 +6,8 @@ import ElementPlus from 'element-plus' import 'element-plus/lib/theme-chalk/index.css' import '/@/theme/index.scss' import lang from 'element-plus/lib/locale/lang/zh-cn' +import mitt from "mitt" -createApp(App).use(router).use(ElementPlus, { locale: lang }).mount('#app') \ No newline at end of file +const app = createApp(App) +app.use(router).use(ElementPlus, { locale: lang }).mount('#app') +app.config.globalProperties.mittBus = mitt() diff --git a/vue-admin-wonderful-next/src/theme/app.scss b/vue-admin-wonderful-next/src/theme/app.scss index 25c1cb1..bf765ab 100644 --- a/vue-admin-wonderful-next/src/theme/app.scss +++ b/vue-admin-wonderful-next/src/theme/app.scss @@ -46,6 +46,9 @@ body, .el-scrollbar { width: 100%; } + .layout-aside-width { + width: 240px !important; + } .layout-scrollbar { @extend .el-scrollbar; padding: 15px; diff --git a/vue-admin-wonderful-next/src/theme/element.scss b/vue-admin-wonderful-next/src/theme/element.scss index c48f45d..9f64499 100644 --- a/vue-admin-wonderful-next/src/theme/element.scss +++ b/vue-admin-wonderful-next/src/theme/element.scss @@ -675,6 +675,7 @@ height: 50px !important; line-height: 50px !important; color: var(--bg-menuBarColor); + transition: none !important; } // horizontal 水平方向时 .el-menu--horizontal > .el-menu-item.is-active, @@ -698,7 +699,6 @@ color: inherit; text-decoration: none; } - // 默认 hover 时 .el-menu-item:hover, .el-submenu__title:hover { @@ -710,12 +710,21 @@ } // 高亮时 .el-menu-item.is-active { + color: set-color(primary); +} +.el-active-extend { color: #ffffff !important; background-color: set-color(primary) !important; i { color: #ffffff !important; } } +.add-is-active { + @extend .el-active-extend; + &:hover { + @extend .el-active-extend; + } +} /* Tabs 标签页 ------------------------------- */ diff --git a/vue-admin-wonderful-next/src/utils/theme.ts b/vue-admin-wonderful-next/src/utils/theme.ts index 24a4b22..b0dd218 100644 --- a/vue-admin-wonderful-next/src/utils/theme.ts +++ b/vue-admin-wonderful-next/src/utils/theme.ts @@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus' // hex颜色转rgb颜色 export function hexToRgb(str: any) { let hexs: any = '' - let reg = /^\#?[0-9A-F]{6}$/ + let reg = /^\#?[0-9A-Fa-f]{6}$/ if (!reg.test(str)) return ElMessage({ type: 'warning', message: "输入错误的hex" }) str = str.replace("#", "") hexs = str.match(/../g) @@ -22,7 +22,7 @@ export function rgbToHex(r: any, g: any, b: any) { // 加深颜色值,level为加深的程度,限0-1之间 export function getDarkColor(color: any, level: number) { - let reg = /^\#?[0-9A-F]{6}$/ + let reg = /^\#?[0-9A-Fa-f]{6}$/ if (!reg.test(color)) return ElMessage({ type: 'warning', message: "输入错误的hex颜色值" }) let rgb = hexToRgb(color) for (let i = 0; i < 3; i++) rgb[i] = Math.floor(rgb[i] * (1 - level)) @@ -31,7 +31,7 @@ export function getDarkColor(color: any, level: number) { // 变浅颜色值,level为加深的程度,限0-1之间 export function getLightColor(color: any, level: number) { - let reg = /^\#?[0-9A-F]{6}$/ + let reg = /^\#?[0-9A-Fa-f]{6}$/ if (!reg.test(color)) return ElMessage({ type: 'warning', message: "输入错误的hex颜色值" }) let rgb = hexToRgb(color) for (let i = 0; i < 3; i++) rgb[i] = Math.floor((255 - rgb[i]) * level + rgb[i]) diff --git a/vue-admin-wonderful-next/src/views/layout/component/aside.vue b/vue-admin-wonderful-next/src/views/layout/component/aside.vue index 67bf855..a167973 100644 --- a/vue-admin-wonderful-next/src/views/layout/component/aside.vue +++ b/vue-admin-wonderful-next/src/views/layout/component/aside.vue @@ -1,5 +1,5 @@