From caa826d7298978d0c1f8aab1716ded76caa876e7 Mon Sep 17 00:00:00 2001 From: JimQing Date: Sun, 17 May 2020 23:04:16 +0800 Subject: [PATCH] feature: fix --- public/assets/css/app.css | 2 +- src/components/codeMirror/header.vue | 4 ++-- src/view/CodemirrorEditor.vue | 25 +++++++++++++------------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/public/assets/css/app.css b/public/assets/css/app.css index d3a5630..7dd6e8a 100644 --- a/public/assets/css/app.css +++ b/public/assets/css/app.css @@ -155,7 +155,7 @@ section { margin: 10px 8px; color: #333; position: relative; - background-color: rgba(0, 0, 0, 0.03); + background-color: rgb(238,238,238); border: 1px solid #f0f0f0; border-radius: 2px; display: flex; diff --git a/src/components/codeMirror/header.vue b/src/components/codeMirror/header.vue index d565853..5924ae8 100644 --- a/src/components/codeMirror/header.vue +++ b/src/components/codeMirror/header.vue @@ -194,9 +194,9 @@ export default { type: 'success' }) clipboardDiv.innerHTML = this.output; // 恢复现场 - this.$emit('refresh') + this.$emit('refresh'); this.$emit('endCopy'); - }, 1000); + }, 350); }, // 自定义CSS样式 async customStyle () { diff --git a/src/view/CodemirrorEditor.vue b/src/view/CodemirrorEditor.vue index 9d83dac..a20a3d5 100644 --- a/src/view/CodemirrorEditor.vue +++ b/src/view/CodemirrorEditor.vue @@ -9,8 +9,8 @@ @showBox="showBox = !showBox" @showAboutDialog="aboutDialogVisible = true" @showDialogForm="dialogFormVisible = true" - @startCopy="startCopy" - @endCopy="isCoping = false, backLightColor = false" + @startCopy="isCoping = true, backLight = true" + @endCopy="endCopy" /> @@ -19,8 +19,8 @@ - -
+ +
@@ -83,8 +83,8 @@ export default { showBox: false, aboutDialogVisible: false, dialogFormVisible: false, - backLightColor: false, isCoping: false, + backLight: false, timeout: null, changeTimer: null, source: '' @@ -240,11 +240,11 @@ export default { this.editorRefresh(); setTimeout(()=> PR.prettyPrint(), 0); }, - startCopy() { - this.isCoping = true; - setTimeout(() => { - this.backLightColor = true; - }, 500); + endCopy() { + this.backLight = false; + setTimeout(()=> { + this.isCoping = false; + }, 800); }, ...mapMutations(['initEditorState', 'initEditorEntity', 'setWxRendererOptions', 'editorRefresh', 'initCssEditorEntity']) @@ -272,8 +272,9 @@ export default { .container { transition: all .3s; } -.preview-wrapper { - transition: all .3s; +.preview { + transition: background 0s; + transition-delay: .2s; } .preview-wrapper_night { overflow-y: inherit;