mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 动态注册组件,优化首页出现性能
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { defineAsyncComponent, AsyncComponentLoader } from 'vue'
|
||||
import { AsyncLoading, AsyncSkeletonLoading } from '@/components/LoadingComponent'
|
||||
|
||||
/**
|
||||
* * 动态注册组件
|
||||
*/
|
||||
export const componentInstall = <T> (key:string, node: T) => {
|
||||
if(!window['$vue'].component(key)) {
|
||||
window['$vue'].component(key, node)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* * 异步加载组件
|
||||
* @param loader
|
||||
|
||||
Reference in New Issue
Block a user