mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 动态注册组件,优化首页出现性能
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { AppleControlBtn } from '@/components/AppleControlBtn/index'
|
||||
import { requireFallbackImg } from '@/utils'
|
||||
import { requireFallbackImg, componentInstall } from '@/utils'
|
||||
import { DragKeyEnum } from '@/enums/editPageEnum'
|
||||
import { ConfigType } from '@/packages/index.d'
|
||||
import omit from 'lodash/omit'
|
||||
@@ -41,6 +41,7 @@ defineProps({
|
||||
|
||||
// 拖拽处理
|
||||
const handleDragStart = (e: DragEvent, item: ConfigType) => {
|
||||
componentInstall(item.key, item.node)
|
||||
// 将配置项绑定到拖拽属性上
|
||||
e!.dataTransfer!.setData(DragKeyEnum.DROG_KEY, JSON.stringify(omit(item, ['node', 'image'])))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user