[add] 文档库和文档拆分模块的详情页

This commit is contained in:
lideqin
2023-08-16 17:41:16 +08:00
parent a5179a58b0
commit 478ba66284
274 changed files with 124834 additions and 14 deletions
+96
View File
@@ -0,0 +1,96 @@
<template>
<div>
<script id="editor" type="text/plain" ></script>
</div>
</template>
<script>
import '@/../public/ueditor/ueditor.config.js'
import '@/../public/ueditor/ueditor.all.js'
import '@/../public/ueditor/lang/zh-cn/zh-cn.js'
import '@/../public/ueditor/lang/en/en.js'
export default {
name: 'UEditor',
data () {
return {
editor: null
}
},
methods: {
getUEContent () {
return this.editor.getContent()
},
getContentTxt () {
return this.editor.getContentTxt()
},
setContent (content) {
return this.editor.ready(() => {
this.editor.setContent(content, true)
})
},
// 清空内容
execCommand (content) {
return this.editor.execCommand('cleardoc')
},
getContentLength () {
return this.editor.getContentLength()
}
},
props: {
id: {
type: String
},
config: {
type: Object
},
fontfamily: {
type: String,
default: ''
},
fontsize: {
type: String,
default: ''
},
bold: {
type: Boolean,
default: false
},
content: {
type: String,
default: ''
}
},
mounted () {
UEDITOR_CONFIG.UEDITOR_HOME_URL = '../../public/ueditor/'
// 初始化UE
this.editor = UE.delEditor('editor')
this.editor = UE.getEditor('editor', this.config)
const _this = this
UE.getEditor('editor').addListener('blur', function (editor) {
_this.$emit('editor-onChange', _this.getUEContent())
})
UE.getEditor('editor').ready(function () {
if (_this.fontfamily !== '') {
UE.getEditor('editor').execCommand('fontfamily', _this.fontfamily)
}
if (_this.content !== '') {
UE.getEditor('editor').setContent(_this.content)
}
if (_this.fontsize !== '') {
UE.getEditor('editor').execCommand('fontsize', _this.fontsize)
}
if (_this.bold) {
UE.getEditor('editor').execCommand('bold')
}
})
},
destoryed () {
this.editor.destory()
}
}
</script>
<style scoped>
</style>