mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-05-15 00:00:02 +08:00
修改动态组件加载时机
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { babelParse } from '@vue/compiler-sfc'
|
||||
import { compileFile } from '@/compiler/sfc-compiler.js'
|
||||
import { ElLoading } from 'element-plus'
|
||||
|
||||
function appComponent(app, item){
|
||||
var compiled = {}
|
||||
@@ -27,10 +28,15 @@ function appComponent(app, item){
|
||||
}
|
||||
|
||||
const install = (app) => {
|
||||
app.config.globalProperties.$post('/component/list', { size: 999999 }).then((res) => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
background: 'rgba(255, 255, 255, 0)',
|
||||
})
|
||||
app.config.globalProperties.$post('/component/list').then((res) => {
|
||||
res.data.forEach(it => {
|
||||
appComponent(app, it)
|
||||
})
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
export default install
|
||||
|
||||
Reference in New Issue
Block a user