Commit f9bb6cc4 authored by tyyin lan's avatar tyyin lan

chore(编辑器): 多语言补充

parent 896134e7
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { type ToolbarAllConfig } from './config/editor-toolbar-config'
interface Props {
......@@ -13,6 +14,8 @@ const emit = defineEmits<{
onSubmenuCmdClick: [toolItemChildCmd: NonNullable<ToolbarAllConfig['key']['submenuCmd']>[0]]
}>()
const { t } = useI18n()
function handleExecuteCommand(toolItem: ToolbarAllConfig['key']) {
emit('onExecuteCommand', toolItem)
}
......@@ -92,12 +95,12 @@ function handleSubmenuCmdClick(toolItemChildCmd: NonNullable<ToolbarAllConfig['k
@mouseenter="handleToolItemMouseenter(toolItem)"
@mouseleave="handleToolItemMouseleave(toolItem)"
>
标题1
{{ t('editor_module.title') }}1
</button>
</template>
<div>
<h1>标题1</h1>
<h1>{{ t('editor_module.title') }}1</h1>
</div>
</NPopover>
</template>
......
......@@ -4,12 +4,14 @@ import { nanoid } from 'nanoid'
import { onMounted, ref, toRaw } from 'vue'
import { type ToolbarAllConfig, useEditorToolbarConfig } from './config/editor-toolbar-config'
import EditorToolItem from './editor-tool-item.vue'
import { useI18n } from 'vue-i18n'
const emit = defineEmits<{
downloadFile: []
}>()
const { toolbarAllConfig } = useEditorToolbarConfig()
const { t } = useI18n()
const currentToolbarString = 'ndo redo removeFormat | blocks bold italic underline strikethrough | align'
......@@ -204,7 +206,7 @@ function handleDownloadFile() {
<i class="iconfont icon-download"></i>
</div>
</template>
下载
{{ t('common_module.download') }}
</n-tooltip>
</div>
</div>
......
......@@ -94,7 +94,12 @@ function handleShowReasoningContentSwitch() {
function handleContentEdit() {
isShowEditorDrawer.value = true
editorDrawerContent.value = props.messageItem.textContent || ''
let content = ''
markdownRenderRef.value && (content = markdownRenderRef.value.getRenderTextContent())
editorDrawerContent.value = content
}
const handleContentCopy = throttle(
......@@ -296,5 +301,5 @@ const handleContentCopy = throttle(
</div>
</div>
<EditorDrawer v-model:is-show-editor-drawer="isShowEditorDrawer" :content="editorDrawerContent" />
<EditorDrawer v-model:is-show-editor-drawer="isShowEditorDrawer" v-model:content-edit="editorDrawerContent" />
</template>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment