From 8c56ab199b1545159737feb54bbb4e8735859dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=92=83=E7=99=BD?= <18511759309@163.com> Date: Thu, 5 Aug 2021 16:18:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 + src/assets/js/utils.js | 25 ++++++++++--- src/assets/style/variable.less | 1 + .../content/components/user-select.vue | 19 ++++++++-- src/components/content/md-textarea.vue | 8 ++-- .../content/mixins/select-user-mixins.js | 37 +++++++++++++------ 6 files changed, 69 insertions(+), 23 deletions(-) diff --git a/src/App.vue b/src/App.vue index bc89509..24088ea 100644 --- a/src/App.vue +++ b/src/App.vue @@ -324,6 +324,8 @@ export default { } if (this.callUserList.length) { emitContent.callUserList = this.callUserList; + } else { + emitContent.callUserList = []; } emitContent.filteredTags = this.filteredTags; diff --git a/src/assets/js/utils.js b/src/assets/js/utils.js index bfbd0e4..c62328f 100644 --- a/src/assets/js/utils.js +++ b/src/assets/js/utils.js @@ -76,7 +76,8 @@ export function initStyle({ contentBgColor, codeBgColor, codeTheme, - helpdocColor + helpdocColor, + itemActiveBgColor }) { // 夜晚模式 if (dark) { @@ -89,6 +90,7 @@ export function initStyle({ codeBgColor = "#777888"; contentBgColor = "#222226"; helpdocColor = "#CCCCD8"; + itemActiveBgColor = "#777888"; } if (frameBgColor) { document.documentElement.style.setProperty( @@ -96,6 +98,12 @@ export function initStyle({ frameBgColor ); } + if (itemActiveBgColor) { + document.documentElement.style.setProperty( + "--md-editor-item-active-bg-color", + itemActiveBgColor + ); + } if (contentBgColor) { document.documentElement.style.setProperty( "--md-editor-content-bg-color", @@ -143,19 +151,19 @@ export function initStyle({ if (codeTheme) { switch (codeTheme) { case "dark": - import("@/assets/style/code/dark.css"); + import("@/assets/style/code/dark.less"); break; case "light": - import("@/assets/style/code/lightfair.css"); + import("@/assets/style/code/lightfair.less"); break; case "atom-one-dark": - import("@/assets/style/code/atom-one-dark.css"); + import("@/assets/style/code/atom-one-dark.less"); break; default: break; } } else { - import("@/assets/style/code/lightfair.css"); + import("@/assets/style/code/lightfair.less"); } } @@ -183,6 +191,13 @@ export function checkBoswer() { ); return agent !== null; } + +export function isAndroid() { + const agent = navigator.userAgent.match( + /(Android)/i + ); + return agent !== null; +} // 去除头部空格行 export function removeBlankLine(val) { if (!val) return ""; diff --git a/src/assets/style/variable.less b/src/assets/style/variable.less index c12a3e5..40f8739 100644 --- a/src/assets/style/variable.less +++ b/src/assets/style/variable.less @@ -7,6 +7,7 @@ --md-editor-content-bg-color: #fff; --md-editor-frame-bg-color-disabled: #f5f7fa; --md-editor-content-bg-color-disabled: #f5f7fa; + --md-editor-item-active-bg-color: #f5f7fa; --md-editor-helpdoc-color: #666666; --md-editor-code-bg-color: #f3f4f5; --md-editor-fullScrren-zIndex: 2000; diff --git a/src/components/content/components/user-select.vue b/src/components/content/components/user-select.vue index de4ba0e..c69275b 100644 --- a/src/components/content/components/user-select.vue +++ b/src/components/content/components/user-select.vue @@ -25,6 +25,7 @@