mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
perf: 优化报错信息捕获,去除setPosition自带函数
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { defineAsyncComponent, AsyncComponentLoader } from 'vue'
|
||||
import { AsyncLoading, AsyncSkeletonLoading } from '@/components/GoLoading'
|
||||
|
||||
/**
|
||||
* * 动态注册组件
|
||||
*/
|
||||
export const componentInstall = <T> (key:string, node: T) => {
|
||||
if(!window['$vue'].component(key) && node) {
|
||||
window['$vue'].component(key, node)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* * 异步加载组件
|
||||
* @param loader
|
||||
* @returns
|
||||
*/
|
||||
export const loadAsyncComponent = (loader: AsyncComponentLoader<any>) =>
|
||||
defineAsyncComponent({
|
||||
loader,
|
||||
loadingComponent: AsyncLoading,
|
||||
delay: 20,
|
||||
})
|
||||
|
||||
export const loadSkeletonAsyncComponent = (loader: AsyncComponentLoader<any>) =>
|
||||
defineAsyncComponent({
|
||||
loader,
|
||||
loadingComponent: AsyncSkeletonLoading,
|
||||
delay: 20,
|
||||
})
|
||||
Reference in New Issue
Block a user