Browse Source

feat

- 添加文章
  - 增加 富文本一些基本配置
feat
JinxChen 2 years ago
parent
commit
8bc2aa30d3
3 changed files with 53 additions and 7 deletions
  1. +13
    -2
      README.md
  2. +3
    -3
      src/main.js
  3. +37
    -2
      src/views/message-manage/main/add-articles/index.vue

+ 13
- 2
README.md View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Date: 2021-11-29 11:14:13 * @Date: 2021-11-29 11:14:13
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2022-09-14 09:05:48
* @LastEditTime: 2022-09-17 14:58:10
* @FilePath: \TelpoUserManageAdmin\README.md * @FilePath: \TelpoUserManageAdmin\README.md
* @description: * @description:
--> -->
@@ -83,4 +83,15 @@ feat
`2022.9.14` `2022.9.14`
feat feat
- 添加文章 - 添加文章
- 富文本编辑器更换为 wangeditor/editor-for-vue
- 富文本编辑器更换为 wangeditor/editor-for-vue


## v1.0.4
`2022.9.17`
feat
- 添加文章
- 增加 富文本一些基本配置
- 添加群发
- 增加 接口对接
- 群发列表
- 增加 接口对接

+ 3
- 3
src/main.js View File

@@ -1,8 +1,8 @@
/* /*
* @Date: 2021-11-30 15:35:16 * @Date: 2021-11-30 15:35:16
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:25:02
* @FilePath: \telpoAdminTemplate\src\main.js
* @LastEditTime: 2022-09-17 15:12:15
* @FilePath: \TelpoUserManageAdmin\src\main.js
* @description: * @description:
*/ */
import Vue from 'vue' import Vue from 'vue'
@@ -10,7 +10,7 @@ import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets import 'normalize.css/normalize.css' // A modern alternative to CSS resets


import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'element-ui/lib/theme-chalk/index.css';
/* import locale from 'element-ui/lib/locale/lang/en' */ // lang i18n /* import locale from 'element-ui/lib/locale/lang/en' */ // lang i18n


import '@/styles/index.scss' // global css import '@/styles/index.scss' // global css


+ 37
- 2
src/views/message-manage/main/add-articles/index.vue View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Date: 2022-08-08 10:09:45 * @Date: 2022-08-08 10:09:45
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2022-09-13 17:00:45
* @LastEditTime: 2022-09-16 16:39:27
* @FilePath: \TelpoUserManageAdmin\src\views\message-manage\main\add-articles\index.vue * @FilePath: \TelpoUserManageAdmin\src\views\message-manage\main\add-articles\index.vue
* @description: 添加文章 * @description: 添加文章
--> -->
@@ -70,6 +70,12 @@
:defaultConfig="editorConfig" :defaultConfig="editorConfig"
:mode="mode" :mode="mode"
@onCreated="onCreated" @onCreated="onCreated"
@onChange="onChange"
@onDestroyed="onDestroyed"
@onMaxLength="onMaxLength"
@onFocus="onFocus"
@onBlur="onBlur"
@customPaste="customPaste"
/> />
</div> </div>
</el-form-item> </el-form-item>
@@ -113,8 +119,16 @@ export default {
fileList: [], fileList: [],
editor: null, editor: null,
toolbarConfig: { }, toolbarConfig: { },
editorConfig: { placeholder: '请输入内容...' },
mode: 'default', // or 'simple' mode: 'default', // or 'simple'
// 菜单配置
editorConfig: {
MENU_CONF: {
uploadImage: {
server: '', //上传图片地址 todo 待后端提供

}
}
}


} }
}, },
@@ -132,6 +146,27 @@ export default {
onCreated(editor) { onCreated(editor) {
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错 this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
}, },
onChange(editor) { console.log('onChange', editor.children) },
onDestroyed(editor) { console.log('onDestroyed', editor) },
onMaxLength(editor) { console.log('onMaxLength', editor) },
onFocus(editor) { console.log('onFocus', editor) },
onBlur(editor) { console.log('onBlur', editor) },
customPaste(editor, event, callback) {
console.log('ClipboardEvent 粘贴事件对象', event)
// const html = event.clipboardData.getData('text/html') // 获取粘贴的 html
// const text = event.clipboardData.getData('text/plain') // 获取粘贴的纯文本
// const rtf = event.clipboardData.getData('text/rtf') // 获取 rtf 数据(如从 word wsp 复制粘贴)

// 自定义插入内容
editor.insertText('')

// 返回 false ,阻止默认粘贴行为
event.preventDefault()
callback(false) // 返回值(注意,vue 事件的返回值,不能用 return)

// 返回 true ,继续默认的粘贴行为
// callback(true)
},
// 清空本地上传的图片列表 // 清空本地上传的图片列表
clearFiles() {}, clearFiles() {},
// 删除上传的图片 // 删除上传的图片


Loading…
Cancel
Save