-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34b626d
commit d2ab551
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
<template> | ||
<MdEditor noIconfont noPrettier v-bind="$attrs"> | ||
<MdEditor :language="language" noIconfont noPrettier v-bind="$attrs"> | ||
<template #defFooters> | ||
<slot name="defFooters"> </slot> | ||
</template> | ||
</MdEditor> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { MdEditor } from 'md-editor-v3' | ||
import { computed } from 'vue' | ||
import { MdEditor, config } from 'md-editor-v3' | ||
import './assets/markdown-iconfont.js' | ||
// 引入公共库中的语言配置 | ||
import ZH_TW from '@vavt/cm-extension/dist/locale/zh-TW' | ||
defineOptions({ name: 'MdEditor' }) | ||
const language = computed(() => localStorage.getItem('MaxKB-locale') || '') | ||
config({ | ||
editorConfig: { | ||
languageUserDefined: { | ||
'zh-Hant': ZH_TW | ||
} | ||
} | ||
}) | ||
</script> |