Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/JakHuang/form-generator into…
Browse files Browse the repository at this point in the history
… dev
  • Loading branch information
JakHuang committed Mar 11, 2021
2 parents 189980a + 71744b3 commit 412e990
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ npm run dev
npm run build
```
## 交流
- QQ群 976154366【已满】 1137173566【2群
- QQ群 976154366【已满】 1137173566【已满】 514953560【3群


## PR鸣谢
Expand Down
4 changes: 3 additions & 1 deletion src/utils/loadBeautifier.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import loadScript from './loadScript'
import ELEMENT from 'element-ui'
import pluginsConfig from './pluginsConfig'

let beautifierObj

export default function loadBeautifier(cb) {
const { beautifierUrl } = pluginsConfig
if (beautifierObj) {
cb(beautifierObj)
return
Expand All @@ -17,7 +19,7 @@ export default function loadBeautifier(cb) {
background: 'rgba(255, 255, 255, 0.5)'
})

loadScript('https://lib.baomitu.com/js-beautify/1.10.2/beautifier.min.js', () => {
loadScript(beautifierUrl, () => {
loading.close()
// eslint-disable-next-line no-undef
beautifierObj = beautifier
Expand Down
3 changes: 2 additions & 1 deletion src/utils/loadMonaco.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { loadScriptQueue } from './loadScript'
import ELEMENT from 'element-ui'
import pluginsConfig from './pluginsConfig'

// monaco-editor单例
let monacoEidtor
Expand All @@ -14,7 +15,7 @@ export default function loadMonaco(cb) {
return
}

const vs = 'https://lib.baomitu.com/monaco-editor/0.19.3/min/vs'
const { monacoEditorUrl: vs } = pluginsConfig

// 使用element ui实现加载提示
const loading = ELEMENT.Loading.service({
Expand Down
5 changes: 4 additions & 1 deletion src/utils/loadTinymce.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import loadScript from './loadScript'
import ELEMENT from 'element-ui'
import pluginsConfig from './pluginsConfig'

let tinymceObj

export default function loadTinymce(cb) {
const { tinymceUrl } = pluginsConfig

if (tinymceObj) {
cb(tinymceObj)
return
Expand All @@ -17,7 +20,7 @@ export default function loadTinymce(cb) {
background: 'rgba(255, 255, 255, 0.5)'
})

loadScript('https://lib.baomitu.com/tinymce/5.3.2/tinymce.min.js', () => {
loadScript(tinymceUrl, () => {
loading.close()
// eslint-disable-next-line no-undef
tinymceObj = tinymce
Expand Down
11 changes: 11 additions & 0 deletions src/utils/pluginsConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const CDN = 'https://lib.baomitu.com/'

function splicingPluginUrl(PluginName, version, fileName) {
return `${CDN}${PluginName}/${version}/${fileName}`
}

export default {
beautifierUrl: splicingPluginUrl('js-beautify', '1.13.5', 'beautifier.min.js'),
monacoEditorUrl: splicingPluginUrl('monaco-editor', '0.19.3', 'min/vs'),
tinymceUrl: splicingPluginUrl('tinymce', '5.3.2', 'tinymce.min.js')
}

0 comments on commit 412e990

Please sign in to comment.