refactor: 优化 ContentWrap 提升拓展能力
parent
0e92472904
commit
c200490585
|
@ -5,25 +5,45 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { CSSProperties } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
|
|
||||||
import { Card } from 'ant-design-vue';
|
import { ShieldQuestion } from '@vben/icons';
|
||||||
|
|
||||||
|
import { Card, Tooltip } from 'ant-design-vue';
|
||||||
|
|
||||||
defineOptions({ name: 'ContentWrap' });
|
defineOptions({ name: 'ContentWrap' });
|
||||||
|
|
||||||
withDefaults(
|
withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
bodyStyle?: CSSProperties;
|
bodyStyle?: CSSProperties;
|
||||||
|
message?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
bodyStyle: () => ({ padding: '10px' }),
|
bodyStyle: () => ({ padding: '10px' }),
|
||||||
title: '',
|
title: '',
|
||||||
|
message: '',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// TODO @puhui999:这个功能,和 vue3 貌似没对全哇?
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Card :body-style="bodyStyle" :title="title" class="mb-4">
|
<Card :body-style="bodyStyle" :title="title" class="mb-4">
|
||||||
|
<template v-if="title" #title>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<span class="text-4 font-[700]">{{ title }}</span>
|
||||||
|
<Tooltip placement="right">
|
||||||
|
<template #title>
|
||||||
|
<div class="max-w-[200px]">{{ message }}</div>
|
||||||
|
</template>
|
||||||
|
<ShieldQuestion :size="14" class="ml-5px" />
|
||||||
|
</Tooltip>
|
||||||
|
<div class="pl-20px flex flex-grow">
|
||||||
|
<slot name="header"></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #extra>
|
||||||
|
<slot name="extra"></slot>
|
||||||
|
</template>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</Card>
|
</Card>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue