Merge remote-tracking branch 'origin/master'

This commit is contained in:
jmal 2020-08-31 18:29:07 +08:00
commit cfaf473827

View File

@ -3,11 +3,11 @@
<dir-tree ref="dirTree"> <dir-tree ref="dirTree">
<el-button slot="footer" size="small" type="primary" @click="confirmSelectDir">确 定</el-button> <el-button slot="footer" size="small" type="primary" @click="confirmSelectDir">确 定</el-button>
</dir-tree> </dir-tree>
<el-header height="120px"> <el-header>
<div class="header-item"> <div class="header-item">
文章标题: 文章标题:
<el-input class="articles-title" placeholder="文章标题" v-model="filename"/> <el-input class="articles-title" placeholder="文章标题" v-model="filename"/>
<el-input class="articles-storage" placeholder="存储位置" v-model="storageLocation" :readonly="true" @click="selectDir"> <el-input v-if="!editStatus" class="articles-storage" placeholder="存储位置" v-model="storageLocation" :readonly="true" @click="selectDir">
<el-button slot="prepend" @click="selectDir">选择位置</el-button> <el-button slot="prepend" @click="selectDir">选择位置</el-button>
</el-input> </el-input>
<el-button v-if="!editStatus" class="release-button" type="primary" @click="add" :loading="adding">发布文章</el-button> <el-button v-if="!editStatus" class="release-button" type="primary" @click="add" :loading="adding">发布文章</el-button>
@ -25,6 +25,7 @@
@save="save" @save="save"
@imgAdd="$imgAdd" @imgAdd="$imgAdd"
@imgDel="$imgDel" @imgDel="$imgDel"
@fullScreen="fullScreen"
/> />
</el-main> </el-main>
</div> </div>
@ -44,9 +45,10 @@
content:"", // 输入的markdown content:"", // 输入的markdown
html:'', // 及时转的html html:'', // 及时转的html
filename: '新建文档', filename: '新建文档',
clientHeight: document.documentElement.clientHeight - 155, clientHeight: document.documentElement.clientHeight - 135,
updating: false, updating: false,
adding: false, adding: false,
isFullScreen: false,
storageLocation: '/', storageLocation: '/',
selectLocationVisible: false, selectLocationVisible: false,
} }
@ -64,7 +66,7 @@
} }
const that = this const that = this
window.onresize = function temp() { window.onresize = function temp() {
that.clientHeight = document.documentElement.clientHeight - 155 that.reHeight()
} }
}, },
methods: { methods: {
@ -104,6 +106,17 @@
// render 为 markdown 解析后的结果[html] // render 为 markdown 解析后的结果[html]
this.html = render; this.html = render;
}, },
fullScreen(status) {
this.isFullScreen = status
this.reHeight()
},
reHeight(){
if(this.isFullScreen){
this.clientHeight = document.documentElement.clientHeight
}else{
this.clientHeight = document.documentElement.clientHeight - 135
}
},
save(){ save(){
if(this.editStatus){ if(this.editStatus){
this.update() this.update()
@ -173,9 +186,12 @@
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .el-main { /deep/ .el-main {
padding: 5px 20px 20px 20px; padding: 5px 20px 20px 20px;
.v-note-wrapper {
z-index: 200;
}
} }
/deep/ .el-header { /deep/ .el-header {
padding: 12.5px 20px 10px 20px; padding: 7.5px 20px 10px 20px;
} }
/deep/ .el-input-group { /deep/ .el-input-group {
width: unset; width: unset;