提交 | 用户 | 时间
|
a57dc2
|
1 |
import loadScript from './loadScript' |
W |
2 |
import ELEMENT from 'element-ui' |
|
3 |
import pluginsConfig from './pluginsConfig' |
|
4 |
|
|
5 |
let tinymceObj |
|
6 |
|
|
7 |
export default function loadTinymce(cb) { |
|
8 |
const { tinymceUrl } = pluginsConfig |
|
9 |
|
|
10 |
if (tinymceObj) { |
|
11 |
cb(tinymceObj) |
|
12 |
return |
|
13 |
} |
|
14 |
|
|
15 |
const loading = ELEMENT.Loading.service({ |
|
16 |
fullscreen: true, |
|
17 |
lock: true, |
|
18 |
text: '富文本资源加载中...', |
|
19 |
spinner: 'el-icon-loading', |
|
20 |
background: 'rgba(255, 255, 255, 0.5)' |
|
21 |
}) |
|
22 |
|
|
23 |
loadScript(tinymceUrl, () => { |
|
24 |
loading.close() |
|
25 |
// eslint-disable-next-line no-undef |
|
26 |
tinymceObj = tinymce |
|
27 |
cb(tinymceObj) |
|
28 |
}) |
|
29 |
} |