44 </div >
55</template >
66<script >
7- // eslint-disable-next-line
8- import tinymce from ' tinymce/tinymce'
97import Editor from ' @tinymce/tinymce-vue'
108import { post } from ' @/lin/plugin/axios'
119
12- import ' tinymce/themes/silver'
13- import ' ./import-all'
14-
1510export default {
1611 name: ' TinymceEditor' ,
1712 props: {
@@ -27,64 +22,50 @@ export default {
2722 type: Number ,
2823 default: undefined ,
2924 },
30- upload_url: {
31- type: String ,
32- default: ' ' ,
33- },
3425 showMenubar: {
3526 type: Boolean ,
3627 default: true ,
3728 },
3829 toolbar: {
3930 type: String ,
40- default: ` undo redo
41- | formatselect
42- | bold italic strikethrough forecolor backcolor formatpainter
43- | link image | alignleft aligncenter alignright alignjustify
44- | numlist bullist outdent indent
45- | removeformat
31+ default: ` undo redo
32+ | formatselect
33+ | bold italic strikethrough forecolor backcolor formatpainter
34+ | link image | alignleft aligncenter alignright alignjustify
35+ | numlist bullist outdent indent
36+ | removeformat
4637 | preview fullscreen code` ,
4738 },
48- baseUrl: {
49- type: String ,
50- default: ' ' ,
51- },
5239 },
5340 components: {
5441 Editor,
5542 },
5643 data () {
5744 return {
45+ content: ' ' ,
5846 tinymceFlag: 1 ,
5947 tinymceInit: {},
60- content: ' ' ,
6148 }
6249 },
6350 created () {
6451 this .tinymceInit = {
65- language_url: ` ${ this .baseUrl } /tinymce/langs/zh_CN.js` ,
66- skin_url: ` ${ this .baseUrl } /tinymce/skins/ui/oxide` ,
67- content_css: ` ${ this .baseUrl } /tinymce/skins/content/default/content.css` ,
6852 language: ' zh_CN' ,
6953 height: this .height ,
70- width: undefined ,
71- browser_spellcheck: true , // 拼写检查
72- branding: false , // 去水印
73- elementpath: false , // 禁用编辑器底部的状态栏
54+ branding: true , // 去水印
7455 statusbar: false , // 隐藏编辑器底部的状态栏
56+ elementpath: false , // 禁用编辑器底部的状态栏
57+ toolbar: this .toolbar ,
7558 paste_data_images: true , // 允许粘贴图像
59+ browser_spellcheck: true , // 拼写检查
7660 menubar: this .showMenubar , // 隐藏最上方menu
77- plugins: ` print fullpage searchreplace autolink directionality visualblocks
78- visualchars template codesample charmap hr pagebreak nonbreaking anchor toc insertdatetime
61+ plugins: ` print fullpage searchreplace autolink directionality visualblocks
62+ visualchars template codesample charmap hr pagebreak nonbreaking anchor toc insertdatetime
7963 wordcount textpattern help advlist table lists paste preview fullscreen image imagetools code link` ,
80- toolbar: this .toolbar ,
8164 async images_upload_handler (blobInfo , success , failure ) {
8265 const file = new File ([blobInfo .blob ()], blobInfo .filename (), {
8366 type: ' image/*' ,
8467 })
85- post (' cms/file' , {
86- file,
87- })
68+ post (' cms/file' , { file })
8869 .then (res => {
8970 if (res .length && res[0 ]? .url ) {
9071 success (res[0 ].url )
@@ -117,3 +98,9 @@ export default {
11798 },
11899}
119100< / script>
101+
102+ < style lang= " scss" >
103+ .tox - notification {
104+ display: none ! important;
105+ }
106+ < / style>
0 commit comments