Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
linshenxs-shop
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈超
linshenxs-shop
Commits
6b55af14
Commit
6b55af14
authored
Jul 18, 2022
by
陈超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A
parent
dc64c2c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
src/components/ckeditor/index.vue
+16
-4
No files found.
src/components/ckeditor/index.vue
View file @
6b55af14
...
@@ -7,11 +7,13 @@
...
@@ -7,11 +7,13 @@
:mode=
"mode"
:mode=
"mode"
@
onChange=
"onChange"
@
onChange=
"onChange"
@
onCreated=
"onCreated"
/>
@
onCreated=
"onCreated"
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
Uploader
}
from
'@/util/oss'
import
{
Editor
,
Toolbar
}
from
'@wangeditor/editor-for-vue'
import
{
Editor
,
Toolbar
}
from
'@wangeditor/editor-for-vue'
import
"@wangeditor/editor/dist/css/style.css"
import
"@wangeditor/editor/dist/css/style.css"
...
@@ -30,7 +32,16 @@
...
@@ -30,7 +32,16 @@
MENU_CONF
:
{
MENU_CONF
:
{
uploadImage
:
{
uploadImage
:
{
async
customUpload
(
file
,
insertFn
)
{
async
customUpload
(
file
,
insertFn
)
{
let
r
=
await
UPLOADER
.
upload
(
'images'
,
file
)
let
bucket
=
''
if
(
file
.
type
.
startsWith
(
'image'
))
{
bucket
=
'images'
}
else
if
(
file
.
type
.
startsWith
(
'video'
))
{
bucket
=
'videos'
}
else
{
req
.
onError
(
'不支持的文件格式'
)
return
}
let
r
=
await
Uploader
.
upload
(
bucket
,
file
)
insertFn
(
r
.
url
,
''
,
r
.
url
)
insertFn
(
r
.
url
,
''
,
r
.
url
)
}
}
}
}
...
@@ -56,12 +67,13 @@
...
@@ -56,12 +67,13 @@
this
.
editor
=
Object
.
seal
(
editor
)
// 一定要用 Object.seal() ,否则会报错
this
.
editor
=
Object
.
seal
(
editor
)
// 一定要用 Object.seal() ,否则会报错
},
},
onChange
(
editor
)
{
onChange
(
editor
)
{
//console.log(editor.getHtml())
this
.
$emit
(
'changed'
,
editor
.
getHtml
())
this
.
$emit
(
'changed'
,
editor
.
getHtml
())
}
}
},
},
mounted
()
{
this
.
html
=
this
.
content
mounted
()
{
// alert("[ mounted ] this.content: "+this.content)
this
.
html
=
this
.
content
},
},
beforeDestroy
()
{
beforeDestroy
()
{
if
(
this
.
editor
)
{
if
(
this
.
editor
)
{
...
...
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