From d4475d0e8d36a75980899246202ea420c3fad935 Mon Sep 17 00:00:00 2001 From: abbfun <819589789@qq.com> Date: 星期三, 27 七月 2022 17:05:31 +0800 Subject: [PATCH] 优化表格上右侧工具条(搜索按钮显隐&右侧样式凸出) 无搜索条件时可通过search隐藏搜索按钮,工具条组右侧样式超出5px(相对于底部表格),其父节点gutter代码生成默认10,此处也默认10,使工具组样式左右一致 --- 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