拓扑图配置
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div style='border: 1px solid #ccc'>
|
||||
<div style='border: 1px solid #e4e4e4;height: 100%'>
|
||||
<Toolbar
|
||||
style='border-bottom: 1px solid #ccc'
|
||||
style='border-bottom: 1px solid #e4e4e4'
|
||||
:editor='editorRef'
|
||||
:defaultConfig='toolbarConfig'
|
||||
mode='default'
|
||||
/>
|
||||
<Editor
|
||||
style='height: 500px; overflow-y: hidden;'
|
||||
v-model='valueHtml'
|
||||
v-bind='$attrs'
|
||||
:defaultConfig='editorConfig'
|
||||
mode='default'
|
||||
@onCreated='handleCreated'
|
||||
style='height: calc(100% - 42px); '
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -33,8 +33,32 @@ onMounted(() => {
|
||||
}, 1500)
|
||||
})
|
||||
|
||||
const toolbarConfig = {}
|
||||
const editorConfig = { placeholder: '请输入内容...' }
|
||||
const toolbarConfig = {
|
||||
excludeKeys: ['fullScreen', 'emotion']
|
||||
}
|
||||
let sever = '/cs-harmonic-boot/csconfiguration/uploadImage'
|
||||
// 本地加api
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
sever = '/api' + sever
|
||||
}
|
||||
const editorConfig = {
|
||||
placeholder: '请输入内容...',
|
||||
MENU_CONF: {
|
||||
uploadImage: {
|
||||
server: sever,
|
||||
fieldName: 'file',
|
||||
compress: true,
|
||||
uploadFileName: 'file',
|
||||
withCredentials: true,
|
||||
headers: {},
|
||||
timeout: 0,
|
||||
customInsert: (insertImg, result, editor) => {
|
||||
const url = result.data.url
|
||||
insertImg(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 组件销毁时,也及时销毁编辑器
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
Reference in New Issue
Block a user