mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
53 lines
1.1 KiB
Vue
Executable File
53 lines
1.1 KiB
Vue
Executable File
<template>
|
|
<VEditor
|
|
v-if="ready"
|
|
v-model="content"
|
|
:leftToolbar="leftToolbar"
|
|
:rightToolbar="rightToolbar"
|
|
:tocNavPositionRight="tocNavPositionRight"
|
|
:includeLevel="includeLevel"/>
|
|
<Loading v-else/>
|
|
</template>
|
|
|
|
<script>
|
|
import {editorMixin} from "./mixin";
|
|
|
|
export default {
|
|
name: 'VMEditor',
|
|
mixins: [editorMixin],
|
|
components: {
|
|
VEditor: () => import('./engine/editor.vue')
|
|
},
|
|
data() {
|
|
return {
|
|
ready: false,
|
|
content: '',
|
|
}
|
|
},
|
|
async mounted() {
|
|
await $A.loadScriptS([
|
|
'js/katex/katex.min.js',
|
|
'js/katex/katex.min.css',
|
|
'js/mermaid.min.js',
|
|
])
|
|
this.ready = true;
|
|
},
|
|
|
|
watch: {
|
|
value: {
|
|
handler(val) {
|
|
if (val == null) {
|
|
val = "";
|
|
}
|
|
this.content = val;
|
|
},
|
|
immediate: true
|
|
},
|
|
|
|
content(val) {
|
|
this.$emit('input', val);
|
|
},
|
|
},
|
|
}
|
|
</script>
|