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
ddfb409c
Commit
ddfb409c
authored
May 30, 2025
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(首页富文本): 写作模式热键开启调整
parent
cf865453
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
26 deletions
+33
-26
index.vue
src/views/home/components/rich-text-input-box/index.vue
+24
-17
quill-opstions.ts
...ews/home/components/rich-text-input-box/quill-opstions.ts
+9
-9
No files found.
src/views/home/components/rich-text-input-box/index.vue
View file @
ddfb409c
...
...
@@ -59,12 +59,23 @@ const uploadImageInfo = computed(() => {
:
{
url
:
''
,
id
:
''
}
})
const
onQuillTextChange
=
debounce
((
delta
:
Delta
)
=>
{
const
question
=
quillContentExtractor
(
delta
)
const
onQuillTextChange
=
debounce
(
()
=>
{
// const question = quillContentExtractor(delta)
const
question
=
quillInst
.
value
?.
getText
().
trim
()
if
(
question
===
'@'
)
{
quillInst
.
value
?.
deleteText
(
0
,
question
.
length
+
1
)
showSceneList
.
value
=
true
quillInst
.
value
?.
blur
()
}
questionContentDraft
.
value
=
question
.
trim
()
questionContent
.
value
=
questionContentDraft
.
value
},
100
)
questionContentDraft
.
value
=
question
||
''
questionContent
.
value
=
questionContentDraft
.
value
},
300
,
{
trailing
:
true
,
leading
:
true
},
)
watch
(
()
=>
currentSceneConfig
.
value
,
...
...
@@ -118,14 +129,6 @@ watchEffect(() => {
quillInst
.
value
.
on
(
'composition-end'
,
()
=>
{
if
(
quillInst
.
value
)
{
quillInst
.
value
.
root
.
dataset
.
placeholder
=
quillInst
.
value
.
options
.
placeholder
const
text
=
quillInst
.
value
.
getText
().
trim
()
if
(
text
===
'@'
)
{
quillInst
.
value
.
deleteText
(
0
,
text
.
length
+
1
)
showSceneList
.
value
=
true
quillInst
.
value
.
blur
()
}
}
})
...
...
@@ -162,11 +165,15 @@ function initQuill() {
handleQuestionSubmit
()
}
},
at
:
()
=>
{
showSceneList
.
value
=
true
//
at: () => {
// const text = quillInst.value?.getText().trim()
quillInst
.
value
?.
blur
()
},
// if (text === '@') {
// showSceneList.value = true
// quillInst.value?.blur()
// }
// },
},
}),
)
...
...
src/views/home/components/rich-text-input-box/quill-opstions.ts
View file @
ddfb409c
...
...
@@ -23,15 +23,15 @@ export function getQuillOptions(config: ConfigInterface): QuillOptions {
}
},
},
'@'
:
{
key
:
'@'
,
shiftKey
:
true
,
handler
:
function
(
range
:
any
,
context
:
any
)
{
if
(
config
.
keyboardCallback
.
at
)
{
config
.
keyboardCallback
.
at
((
this
as
any
).
quill
as
Quill
,
range
,
context
)
}
},
},
//
'@': {
//
key: '@',
//
shiftKey: true,
//
handler: function (range: any, context: any) {
//
if (config.keyboardCallback.at) {
//
config.keyboardCallback.at((this as any).quill as Quill, range, context)
//
}
//
},
//
},
// tab: {
// key: 'Tab',
// handler: function () {
...
...
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