Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
f9bb6cc4
Commit
f9bb6cc4
authored
Mar 08, 2025
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(编辑器): 多语言补充
parent
896134e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
editor-tool-item.vue
src/components/custom-editor/editor-tool-item.vue
+5
-2
editor-toolbar.vue
src/components/custom-editor/editor-toolbar.vue
+3
-1
message-item.vue
src/views/share/components/message-item.vue
+7
-2
No files found.
src/components/custom-editor/editor-tool-item.vue
View file @
f9bb6cc4
<
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>
...
...
src/components/custom-editor/editor-toolbar.vue
View file @
f9bb6cc4
...
...
@@ -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>
...
...
src/views/share/components/message-item.vue
View file @
f9bb6cc4
...
...
@@ -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"
:
conten
t
=
"editorDrawerContent"
/>
<
EditorDrawer
v
-
model
:
is
-
show
-
editor
-
drawer
=
"isShowEditorDrawer"
v
-
model
:
content
-
edi
t
=
"editorDrawerContent"
/>
<
/template
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment