From fd1bbcf004835251ec9e1159b8665bdc702ef815 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 24 Aug 2020 17:27:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=AF=A5=EF=BC=9A=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=B7=BB=E5=8A=A0=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Icon/Icon.vue | 30 ++++++++ src/components/preview/SimTextPreview.vue | 83 +++++++++++++++++------ 2 files changed, 93 insertions(+), 20 deletions(-) create mode 100644 src/components/Icon/Icon.vue diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue new file mode 100644 index 0000000..3f2723e --- /dev/null +++ b/src/components/Icon/Icon.vue @@ -0,0 +1,30 @@ + + + + diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index 6e13902..4615329 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -40,8 +40,24 @@
保存所有 - - + + + + @@ -79,9 +95,21 @@ :name="item.name" > {{item.title}} -
+
+ + />
@@ -119,11 +147,12 @@ import FancyTree from"@/components/FancyTree" import MessageDialog from "@/components/message/MessageDialog" import FilePathNav from '@/components/Breadcrumb/FilePathNav' + import Icon from '@/components/Icon/Icon.vue' export default { name: "SimTextPreview", components: { - MonacoEditor,FileTree,FancyTree,MessageDialog,FilePathNav + Icon,MonacoEditor,FileTree,FancyTree,MessageDialog,FilePathNav }, props: { file: { @@ -149,7 +178,7 @@ }, data(){ return{ - lightTheme: false, + lightTheme: true, contentsHide: false, defalutLanguage: 'redis', lineWrapping: false, @@ -191,6 +220,10 @@ editableTabsValue: '1', editableTabs: [], filePathNav: '', + toolbars: { + readmodel: true, // 沉浸式阅读 + navigation: true, // 导航目录 + } } }, mounted() { @@ -279,7 +312,6 @@ content: res.data.contentText }) this.editableTabsValue = pathname - // 界面的渲染后的初始化工作 this.$nextTick(()=>{ this.onDialogDblClick() @@ -295,6 +327,11 @@ if(visible && this.loading.closed){ this.textPreviewVisible = true } + }, + editableTabsValue(value){ + if(value.endsWith('.md')){ + this.previewMode = false + } } }, methods:{ @@ -719,7 +756,7 @@ this.removeIndex = removeIndex this.isTabSaveDialogVisible = true } - } + }, } } @@ -763,6 +800,23 @@ } } + >>> .v-note-show.single-show { + ::-webkit-scrollbar { + width: 10px!important; + height: 10px!important; + } + ::-webkit-scrollbar-thumb { + border: unset!important; + background-color: #c1c1c1 !important; + border-radius: unset!important; + } + ::-webkit-scrollbar-track-piece { + border: unset!important; + background-color: #ececec !important; + border-radius: unset!important; + } + } + /deep/.el-dialog { /*width: 1035px;*/ margin: 0 !important; @@ -782,16 +836,6 @@ border: 1px solid #3e3e3e; color: #ffffff; } - /*.el-button:focus{*/ - /*background: #FFF;*/ - /*border: 1px solid #DCDFE6;*/ - /*color: #606266;*/ - /*}*/ - /*.dark-button:focus{*/ - /*background: #3e3e3e;*/ - /*border: 1px solid #3e3e3e;*/ - /*color: #ffffff;*/ - /*}*/ .light-button:hover { background: #DCDFE6; } @@ -1165,7 +1209,6 @@ cursor: nwse-resize; } } -