Skip to content

Commit a499fae

Browse files
author
cond0r@desktop
committed
增加icon
1 parent 9976e21 commit a499fae

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

bin/web_linux_amd64

2.08 MB
Binary file not shown.

bin/web_windows_amd64.exe

2.08 MB
Binary file not shown.

frontend/src/components/Main.vue

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="body">
1515
<el-row>
1616
<!-- v-bind:style="{ width: detailWidth + 'px' }" -->
17-
<el-col id="menu" class="left" :span="5"
17+
<el-col id="menu" class="left" :span="menu_span"
1818
>
1919
<div class="bg-purple">
2020
<el-input
@@ -34,7 +34,7 @@
3434
</el-tree>
3535
</div></el-col
3636
>
37-
<el-col id="content" class="right" :span="19"
37+
<el-col id="content" :style="{ 'padding-left' : content_left_padding+'px'}" class="right" :span="content_span"
3838
><div class=" bg-purple-light">
3939
<mavon-editor
4040
:toolbars="markdownOption"
@@ -69,10 +69,13 @@ export default {
6969
title: "Obsidian Web",
7070
keyword: "",
7171
detailWidth:'300',
72+
menu_span:5,
73+
content_span:19,
74+
content_left_padding:20,
7275
};
7376
},
7477
mounted() {
75-
78+
this.resize();
7679
var index='index.md'
7780
if(this.$route.query.path){
7881
index = this.$route.query.path;
@@ -81,15 +84,13 @@ export default {
8184
axios.get(this.server + "/list").then(resp => {
8285
console.log("send requests");
8386
this.filelist = [];
84-
this.filelist.push({
85-
label: "首页",
86-
name: "首页",
87-
fullpath: index,
88-
type: "file"
89-
});
9087
this.filelist = this.filelist.concat(resp.data.nodes);
9188
this.fulllist = this.filelist;
9289
this.title = resp.data.title;
90+
if(index){
91+
const filename=index.split('/');
92+
this.title=filename[filename.length-1]
93+
}
9394
});
9495
this.readFile(index)
9596
// this.dragControllerDiv()
@@ -115,6 +116,13 @@ export default {
115116
}
116117
},
117118
methods: {
119+
resize(){
120+
if(screen.width<screen.height){
121+
this.menu_span=0;
122+
this.content_span=24
123+
this.content_left_padding=0
124+
}
125+
},
118126
readFile(path){
119127
axios.get(this.server + "/files/"+encodeURIComponent(path)).then(resp => {
120128
// var html=resp.data.text;
@@ -268,7 +276,6 @@ export default {
268276
max-height: 730px;
269277
height: 730px;
270278
overflow: hidden;
271-
padding-left: 20px;
272279
padding-right: 20px;
273280
scrollbar-width: none;
274281

0 commit comments

Comments
 (0)