From 414a43c4a189bbbe4554b1e3aa72df635c532a90 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 8 Jun 2020 08:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 3 +- package.json | 1 + src/components/FileTree/index.vue | 4 +- src/components/preview/SimTextPreview.vue | 14 +- src/main.js | 5 + src/router/index.js | 24 +-- src/views/demo/index.vue | 184 +++++++++++----------- 7 files changed, 127 insertions(+), 108 deletions(-) diff --git a/babel.config.js b/babel.config.js index 44182c3..a4d58f4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -7,6 +7,7 @@ module.exports = { libraryName: 'vant', libraryDirectory: 'es', style: true - }, 'vant'] + }, 'vant'], + ["import", { "libraryName": "ant-design-vue", "libraryDirectory": "es", "style": "css" }] ] } diff --git a/package.json b/package.json index 1efee73..e8b6c77 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@moefe/vue-aplayer": "^2.0.0-beta.5", + "ant-design-vue": "^1.6.2", "axios": "0.18.1", "clipboard": "^2.0.6", "cropperjs": "^1.5.6", diff --git a/src/components/FileTree/index.vue b/src/components/FileTree/index.vue index d797164..28cc120 100644 --- a/src/components/FileTree/index.vue +++ b/src/components/FileTree/index.vue @@ -58,7 +58,9 @@ let keys = [] this.directoryTreeData.forEach(file => { if(!file.isLeaf){ - keys.push(file.path) + if(keys.length < 1){ + keys.push(file.path) + } } }) return keys diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index a700724..144787f 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -356,7 +356,8 @@ /deep/.content { border-top: unset!important; - background-color: #1e1e1e; + /*background-color: #1e1e1e;*/ + background-color: #fff; .editor_main_storey { display: inline-block; position: absolute; @@ -445,7 +446,16 @@ border-top: 1px solid #ccc; display: flex; .file-contents{ - width: 250px; + width: 300px; + height: 500px; + overflow-y: scroll; + overflow-x: hidden; + .svg-icon { + font-size: 18px; + } + /deep/.el-tree-node>.el-tree-node__children{ + overflow: unset; + } } } diff --git a/src/main.js b/src/main.js index f70966e..b44fc7c 100644 --- a/src/main.js +++ b/src/main.js @@ -17,6 +17,11 @@ import VueWechatTitle from 'vue-wechat-title' // import 'we-vue/lib/style.css' import { Popup,Search, Button, Cell, CellGroup, Image, List, PullRefresh, SwipeCell, Col, Row, Divider, Sticky, NavBar, Icon, Tabbar, TabbarItem, ActionSheet, Field, Overlay, Checkbox, CheckboxGroup, Grid, GridItem} from 'vant'; + +// ant-design-vue +import { Tree } from 'ant-design-vue'; +Vue.use(Tree) + // mavonEditor import mavonEditor from 'mavon-editor' import 'mavon-editor/dist/css/index.css' diff --git a/src/router/index.js b/src/router/index.js index 54040b6..7dcf11e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -166,18 +166,18 @@ export const constantRoutes = [ ] }, - // { - // path: '/demo', - // component: Layout, - // children: [ - // { - // path: 'index', - // name: 'demo', - // component: () => import('@/views/demo/index'), - // meta: { title: 'demo', icon: 'example' } - // } - // ] - // }, + { + path: '/demo', + component: Layout, + children: [ + { + path: 'index', + name: 'demo', + component: () => import('@/views/demo/index'), + meta: { title: 'demo', icon: 'example' } + } + ] + }, { path: '/markdown', diff --git a/src/views/demo/index.vue b/src/views/demo/index.vue index 43d6737..04a57cc 100644 --- a/src/views/demo/index.vue +++ b/src/views/demo/index.vue @@ -1,105 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +