|
|
@@ -1,7 +1,7 @@ |
|
|
|
<!-- |
|
|
|
* @Date: 2022-08-08 10:09:45 |
|
|
|
* @LastEditors: JinxChen |
|
|
|
* @LastEditTime: 2022-08-09 16:44:50 |
|
|
|
* @LastEditTime: 2022-09-13 17:00:45 |
|
|
|
* @FilePath: \TelpoUserManageAdmin\src\views\message-manage\main\add-articles\index.vue |
|
|
|
* @description: 添加文章 |
|
|
|
--> |
|
|
@@ -55,8 +55,23 @@ |
|
|
|
|
|
|
|
<!-- 富文本编辑器 --> |
|
|
|
<el-form-item label="文章内容:"> |
|
|
|
<tinymce v-model="form.articleContent" :height="5" menubar="false" /> |
|
|
|
<!-- <tinymce v-model="form.articleContent" :height="5" menubar="false" /> --> |
|
|
|
<!-- <p>文章内容:{{form.articleContent}}</p> --> |
|
|
|
<div style="border: 1px solid #ccc;"> |
|
|
|
<Toolbar |
|
|
|
style="border-bottom: 1px solid #ccc" |
|
|
|
:editor="editor" |
|
|
|
:defaultConfig="toolbarConfig" |
|
|
|
:mode="mode" |
|
|
|
/> |
|
|
|
<Editor |
|
|
|
style="height: 350px; overflow-y: hidden;" |
|
|
|
v-model="form.articleContent" |
|
|
|
:defaultConfig="editorConfig" |
|
|
|
:mode="mode" |
|
|
|
@onCreated="onCreated" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<!-- 保存 --> |
|
|
@@ -70,10 +85,11 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import TopMenu from "@/components/TopMenu/index"; |
|
|
|
import Tinymce from '@/components/Tinymce' |
|
|
|
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'; |
|
|
|
/* import Tinymce from '@/components/Tinymce' */ |
|
|
|
export default { |
|
|
|
name: 'wechat-fans', |
|
|
|
components: { TopMenu, Tinymce }, |
|
|
|
components: { TopMenu, /* Tinymce */ Editor, Toolbar }, |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
buttonList: [], // 头部按钮,例子: {name: '添加', type: 'primary', icon: 'el-icon-circle-plus', click: () => { this.AddDialog();}} |
|
|
@@ -95,6 +111,10 @@ export default { |
|
|
|
], |
|
|
|
// 图片列表 |
|
|
|
fileList: [], |
|
|
|
editor: null, |
|
|
|
toolbarConfig: { }, |
|
|
|
editorConfig: { placeholder: '请输入内容...' }, |
|
|
|
mode: 'default', // or 'simple' |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
@@ -103,7 +123,15 @@ export default { |
|
|
|
this.clearFiles(); |
|
|
|
console.log("本地的上传图片列表", this.fileList); |
|
|
|
}, |
|
|
|
beforeDestroy() { |
|
|
|
const editor = this.editor |
|
|
|
if (editor == null) return |
|
|
|
editor.destroy() // 组件销毁时,及时销毁编辑器 |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onCreated(editor) { |
|
|
|
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错 |
|
|
|
}, |
|
|
|
// 清空本地上传的图片列表 |
|
|
|
clearFiles() {}, |
|
|
|
// 删除上传的图片 |
|
|
@@ -151,6 +179,7 @@ export default { |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style src="@wangeditor/editor/dist/css/style.css"></style> |
|
|
|
<style scoped lang="scss"> |
|
|
|
.home-container { |
|
|
|
position: relative; |
|
|
|