mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
perf: 优化描述组件
This commit is contained in:
parent
983a636928
commit
6a542b6104
@ -2,7 +2,7 @@
|
|||||||
import { ElCollapseTransition, ElDescriptions, ElDescriptionsItem, ElTooltip } from 'element-plus'
|
import { ElCollapseTransition, ElDescriptions, ElDescriptionsItem, ElTooltip } from 'element-plus'
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
import { ref, unref, PropType, computed, useAttrs } from 'vue'
|
import { ref, unref, PropType, computed, useAttrs, useSlots } from 'vue'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { DescriptionsSchema } from '@/types/descriptions'
|
import { DescriptionsSchema } from '@/types/descriptions'
|
||||||
|
|
||||||
@ -12,6 +12,8 @@ const mobile = computed(() => appStore.getMobile)
|
|||||||
|
|
||||||
const attrs = useAttrs()
|
const attrs = useAttrs()
|
||||||
|
|
||||||
|
const slots = useSlots()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: propTypes.string.def(''),
|
title: propTypes.string.def(''),
|
||||||
message: propTypes.string.def(''),
|
message: propTypes.string.def(''),
|
||||||
@ -96,6 +98,9 @@ const toggleClick = () => {
|
|||||||
:direction="mobile ? 'vertical' : 'horizontal'"
|
:direction="mobile ? 'vertical' : 'horizontal'"
|
||||||
v-bind="getBindValue"
|
v-bind="getBindValue"
|
||||||
>
|
>
|
||||||
|
<template v-if="slots['extra']" #extra>
|
||||||
|
<slot name="extra"></slot>
|
||||||
|
</template>
|
||||||
<ElDescriptionsItem
|
<ElDescriptionsItem
|
||||||
v-for="item in schema"
|
v-for="item in schema"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
|
Loading…
Reference in New Issue
Block a user