提交 | 用户 | 时间
|
820397
|
1 |
<script lang="ts" setup> |
H |
2 |
import { propTypes } from '@/utils/propTypes' |
|
3 |
import { useDesign } from '@/hooks/web/useDesign' |
|
4 |
|
|
5 |
defineOptions({ name: 'ContentWrap' }) |
|
6 |
|
|
7 |
const { getPrefixCls } = useDesign() |
|
8 |
|
|
9 |
const prefixCls = getPrefixCls('content-wrap') |
|
10 |
|
|
11 |
defineProps({ |
|
12 |
title: propTypes.string.def(''), |
|
13 |
message: propTypes.string.def(''), |
9259c2
|
14 |
bodyStyle: propTypes.object.def({ padding: '10px' }) |
820397
|
15 |
}) |
H |
16 |
</script> |
|
17 |
|
|
18 |
<template> |
|
19 |
<ElCard :body-style="bodyStyle" :class="[prefixCls, 'mb-15px']" shadow="never"> |
|
20 |
<template v-if="title" #header> |
|
21 |
<div class="flex items-center"> |
|
22 |
<span class="text-16px font-700">{{ title }}</span> |
|
23 |
<ElTooltip v-if="message" effect="dark" placement="right"> |
|
24 |
<template #content> |
|
25 |
<div class="max-w-200px">{{ message }}</div> |
|
26 |
</template> |
|
27 |
<Icon :size="14" class="ml-5px" icon="ep:question-filled" /> |
|
28 |
</ElTooltip> |
|
29 |
<div class="flex flex-grow pl-20px"> |
|
30 |
<slot name="header"></slot> |
|
31 |
</div> |
|
32 |
</div> |
|
33 |
</template> |
|
34 |
<slot></slot> |
|
35 |
</ElCard> |
|
36 |
</template> |