1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
| <script lang="ts" setup>
| const props = defineProps({
| // 标题
| title: {
| type: String,
| default: '',
| },
| // 自定义类名
| customClass: {
| type: String,
| default: '',
| },
| // 垂直间距
| ver: {
| type: [Number, String],
| default: 10,
| },
| // 水平间距
| hor: {
| type: [Number, String],
| default: 15,
| },
| // 是否透明
| transparent: {
| type: Boolean,
| default: false,
| },
| })
|
| const style = computed(() => {
| return `margin: 0 ${props.hor}px;padding:${props.ver}px 0;`
| })
| </script>
|
| <script lang="ts">
| export default {
| options: {
| addGlobalClass: true,
| virtualHost: true,
| styleIsolation: 'shared',
| },
| }
| </script>
|
| <template>
| <view
| class="mb-3 box-border w-full px-3 text-gray-500 last:mb-0 dark:text-gray-300"
| :class="[
| transparent ? '' : 'bg-white dark:bg-[var(--wot-dark-background2)]',
| customClass,
| ]"
| >
| <view class="px-4 py-3 text-26rpx">
| {{ title }}
| </view>
| <view :style="transparent ? '' : style">
| <slot />
| </view>
| </view>
| </template>
|
|