From e02f6923593bd49f87caccd87e063baf312aaa3f Mon Sep 17 00:00:00 2001
From: 稚屿 <1491182878@qq.com>
Date: Mon, 22 Aug 2022 14:19:08 +0800
Subject: [PATCH] 修复菜单管理已知问题 问题描述:在菜单管理下,类型为菜单或者按钮的条目下点击修改按钮。 情况1,如果是类型为菜单,第一次点击修改按钮正常,则第二次点击另一个条目后面的修改按钮时报错! 情况2,如果是类型为按钮,第一次点击修改时正常,当点击取消按钮关闭弹窗时,浏览器报错!
---
ruoyi-ui/src/components/ThemePicker/index.vue | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/ruoyi-ui/src/components/ThemePicker/index.vue b/ruoyi-ui/src/components/ThemePicker/index.vue
index 5c16ee4..4ba9bd2 100644
--- a/ruoyi-ui/src/components/ThemePicker/index.vue
+++ b/ruoyi-ui/src/components/ThemePicker/index.vue
@@ -31,18 +31,21 @@
immediate: true
},
async theme(val) {
+ await this.setTheme(val)
+ }
+ },
+ created() {
+ if(this.defaultTheme !== ORIGINAL_THEME) {
+ this.setTheme(this.defaultTheme)
+ }
+ },
+
+ methods: {
+ async setTheme(val) {
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
-
- const $message = this.$message({
- message: ' Compiling the theme',
- customClass: 'theme-message',
- type: 'success',
- duration: 0,
- iconClass: 'el-icon-loading'
- })
const getHandler = (variable, id) => {
return () => {
@@ -80,12 +83,8 @@
})
this.$emit('change', val)
+ },
- $message.close()
- }
- },
-
- methods: {
updateStyle(style, oldCluster, newCluster) {
let newStyle = style
oldCluster.forEach((color, index) => {
--
Gitblit v1.9.2