4
4
</div >
5
5
</template >
6
6
<script >
7
- // eslint-disable-next-line
8
- import tinymce from ' tinymce/tinymce'
9
7
import Editor from ' @tinymce/tinymce-vue'
10
8
import { post } from ' @/lin/plugin/axios'
11
9
12
- import ' tinymce/themes/silver'
13
- import ' ./import-all'
14
-
15
10
export default {
16
11
name: ' TinymceEditor' ,
17
12
props: {
@@ -27,64 +22,50 @@ export default {
27
22
type: Number ,
28
23
default: undefined ,
29
24
},
30
- upload_url: {
31
- type: String ,
32
- default: ' ' ,
33
- },
34
25
showMenubar: {
35
26
type: Boolean ,
36
27
default: true ,
37
28
},
38
29
toolbar: {
39
30
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
46
37
| preview fullscreen code` ,
47
38
},
48
- baseUrl: {
49
- type: String ,
50
- default: ' ' ,
51
- },
52
39
},
53
40
components: {
54
41
Editor,
55
42
},
56
43
data () {
57
44
return {
45
+ content: ' ' ,
58
46
tinymceFlag: 1 ,
59
47
tinymceInit: {},
60
- content: ' ' ,
61
48
}
62
49
},
63
50
created () {
64
51
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` ,
68
52
language: ' zh_CN' ,
69
53
height: this .height ,
70
- width: undefined ,
71
- browser_spellcheck: true , // 拼写检查
72
- branding: false , // 去水印
73
- elementpath: false , // 禁用编辑器底部的状态栏
54
+ branding: true , // 去水印
74
55
statusbar: false , // 隐藏编辑器底部的状态栏
56
+ elementpath: false , // 禁用编辑器底部的状态栏
57
+ toolbar: this .toolbar ,
75
58
paste_data_images: true , // 允许粘贴图像
59
+ browser_spellcheck: true , // 拼写检查
76
60
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
79
63
wordcount textpattern help advlist table lists paste preview fullscreen image imagetools code link` ,
80
- toolbar: this .toolbar ,
81
64
async images_upload_handler (blobInfo , success , failure ) {
82
65
const file = new File ([blobInfo .blob ()], blobInfo .filename (), {
83
66
type: ' image/*' ,
84
67
})
85
- post (' cms/file' , {
86
- file,
87
- })
68
+ post (' cms/file' , { file })
88
69
.then (res => {
89
70
if (res .length && res[0 ]? .url ) {
90
71
success (res[0 ].url )
@@ -117,3 +98,9 @@ export default {
117
98
},
118
99
}
119
100
< / script>
101
+
102
+ < style lang= " scss" >
103
+ .tox - notification {
104
+ display: none ! important;
105
+ }
106
+ < / style>
0 commit comments