mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 15:09:10 +08:00

* feature: Add experiment RTL support * fix: binding to currentfile textdirection * feature: add sourcecode RTL support * feature: add text direction menu upgrade * fix sourceCode does't change from menu switch text direction
79 lines
1.5 KiB
Vue
79 lines
1.5 KiB
Vue
<template>
|
|
<div
|
|
class="editor-with-tabs"
|
|
>
|
|
<tabs v-show="showTabBar"></tabs>
|
|
<div class="container">
|
|
<editor
|
|
:theme="theme"
|
|
:markdown="markdown"
|
|
:cursor="cursor"
|
|
:text-direction="textDirection"
|
|
></editor>
|
|
<source-code
|
|
v-if="sourceCode"
|
|
:theme="theme"
|
|
:markdown="markdown"
|
|
:cursor="cursor"
|
|
:text-direction="textDirection"
|
|
></source-code>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Tabs from './tabs.vue'
|
|
import Editor from './editor.vue'
|
|
import SourceCode from './sourceCode.vue'
|
|
|
|
export default {
|
|
props: {
|
|
theme: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
markdown: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
cursor: {
|
|
validator (value) {
|
|
return typeof value === 'object'
|
|
},
|
|
required: true
|
|
},
|
|
sourceCode: {
|
|
type: Boolean,
|
|
required: true
|
|
},
|
|
showTabBar: {
|
|
type: Boolean,
|
|
required: true
|
|
},
|
|
textDirection: {
|
|
type: String,
|
|
required: true
|
|
}
|
|
},
|
|
components: {
|
|
Tabs,
|
|
Editor,
|
|
SourceCode
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.editor-with-tabs {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: calc(100vh - var(--titleBarHeight));
|
|
overflow: hidden;
|
|
& > .container {
|
|
flex: 1;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
</style>
|