Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
f78b7789
Commit
f78b7789
authored
Oct 29, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复图片链接上传、图片选中
parent
25abfa76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
editor.scss
src/assets/sass/editor.scss
+3
-0
ImageModal.vue
src/components/Editor/ImageModal.vue
+5
-0
No files found.
src/assets/sass/editor.scss
View file @
f78b7789
@import
'./variables.scss'
;
@import
'./variables.scss'
;
.el-tiptap-editor
{
.el-tiptap-editor
{
.ProseMirror-selectednode
{
border
:
3px
solid
skyblue
;
}
word-wrap
:
break-word
;
word-wrap
:
break-word
;
white-space
:
break-spaces
;
white-space
:
break-spaces
;
$root
:
&
;
$root
:
&
;
...
...
src/components/Editor/ImageModal.vue
View file @
f78b7789
...
@@ -47,6 +47,7 @@ import vue2Dropzone from 'vue2-dropzone'
...
@@ -47,6 +47,7 @@ import vue2Dropzone from 'vue2-dropzone'
import
'vue2-dropzone/dist/vue2Dropzone.min.css'
import
'vue2-dropzone/dist/vue2Dropzone.min.css'
import
FileService
from
'@/service/FileService/index'
import
FileService
from
'@/service/FileService/index'
import
{
Editor
}
from
'@tiptap/vue-2'
import
{
Editor
}
from
'@tiptap/vue-2'
import
{
message
}
from
'ant-design-vue'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
components
:
{
vueDropzone
:
vue2Dropzone
},
components
:
{
vueDropzone
:
vue2Dropzone
},
...
@@ -91,6 +92,10 @@ export default Vue.extend({
...
@@ -91,6 +92,10 @@ export default Vue.extend({
},
},
handleOk
(
e
:
Event
)
{
handleOk
(
e
:
Event
)
{
if
(
this
.
imageSrc
)
{
if
(
this
.
imageSrc
)
{
if
(
!
this
.
imageSrc
.
match
(
/^https:
\/\/
/
)){
message
.
error
(
'请输入正确的图片链接'
)
return
;
}
this
.
editor
.
chain
().
focus
().
setImage
({
src
:
this
.
imageSrc
}).
run
()
this
.
editor
.
chain
().
focus
().
setImage
({
src
:
this
.
imageSrc
}).
run
()
this
.
cursorToEnd
()
this
.
cursorToEnd
()
}
else
if
(
this
.
$refs
.
myVueDropzone
as
any
)
{
}
else
if
(
this
.
$refs
.
myVueDropzone
as
any
)
{
...
...
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