From f3ad3e21880402172f5bdce479f267a5c4b7df08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Tue, 11 Oct 2022 11:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 50 ++++++++++++++++++- .../activity/components/activity-item.vue | 11 +++- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c9114c5..63e2619 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,52 @@ v1.10.0 授权码 dk9mcwJyetRWQlxWRiojIqJWdzJCLi4Wa4QDN5ojI0NWZIVnI6ICZpJCLiwiI https://nodejs.org/en/ 升级npm -npm install -g npm \ No newline at end of file +npm install -g npm + + +tinymce编辑器参数设置 +tinymce.init({ + selector: '#tinydemo2', + //skin:'oxide-dark', + language:'zh_CN', + plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave bdmap indent2em autoresize formatpainter axupimgs', + toolbar: 'code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | \ + styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \ + table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs', + height: 650, //编辑器高度 + min_height: 400, + /*content_css: [ //可设置编辑区内容展示的css,谨慎使用 + '/static/reset.css', + '/static/ax.css', + '/static/css.css', + ],*/ + fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px', + font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;', + link_list: [ + { title: '预置链接1', value: 'http://www.tinymce.com' }, + { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } + ], + image_list: [ + { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, + { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } + ], + image_class_list: [ + { title: 'None', value: '' }, + { title: 'Some class', value: 'class-name' } + ], + importcss_append: true, + //自定义文件选择器的回调内容 + file_picker_callback: function (callback, value, meta) { + if (meta.filetype === 'file') { + callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); + } + if (meta.filetype === 'image') { + callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); + } + if (meta.filetype === 'media') { + callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); + } + }, + toolbar_sticky: true, + autosave_ask_before_unload: false, +}); \ No newline at end of file diff --git a/src/views/sylive/activity/components/activity-item.vue b/src/views/sylive/activity/components/activity-item.vue index 7563f4d..3a07b02 100644 --- a/src/views/sylive/activity/components/activity-item.vue +++ b/src/views/sylive/activity/components/activity-item.vue @@ -107,7 +107,11 @@ return { editversion: false, editoption: { - height: 300 + height: 300, + toolbar: [ + 'code | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | fontsizeselect | bullist numlist | \ + table emoticons hr preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs' + ] }, defaultForm, // 表单数据 @@ -267,7 +271,10 @@ margin-top: 5px; margin-bottom: 5px; } - .tox-toolbar__group:last-child { + .tox-menubar { display: none !important; } + /* .tox-toolbar__group:last-child { + display: none !important; + } */