@hlw-uni/mp-vue 2.1.16 → 2.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
2
|
+
<view
|
|
3
|
+
class="hlw-card-header"
|
|
4
|
+
:class="{ 'hlw-card-header--divider': divider }"
|
|
5
|
+
>
|
|
3
6
|
<view class="hlw-card-header__left">
|
|
4
7
|
<slot name="left">
|
|
5
8
|
<text v-if="icon" class="hlw-card-header__icon" :class="icon" />
|
|
@@ -54,12 +57,15 @@ interface Props {
|
|
|
54
57
|
icon?: string;
|
|
55
58
|
/** 右侧附加文字(无 right slot 时显示) */
|
|
56
59
|
extra?: string;
|
|
60
|
+
/** 是否在头部底部显示虚线分隔线,默认 false。线型由 CSS 变量 `--card-header-divider-style`(默认 dashed)控制 */
|
|
61
|
+
divider?: boolean;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
const props = withDefaults(defineProps<Props>(), {
|
|
60
65
|
title: "",
|
|
61
66
|
icon: "",
|
|
62
67
|
extra: "",
|
|
68
|
+
divider: false,
|
|
63
69
|
});
|
|
64
70
|
|
|
65
71
|
const slots = useSlots();
|
|
@@ -79,6 +85,13 @@ defineOptions({
|
|
|
79
85
|
justify-content: space-between;
|
|
80
86
|
padding: 24rpx 28rpx;
|
|
81
87
|
box-sizing: border-box;
|
|
88
|
+
|
|
89
|
+
&--divider {
|
|
90
|
+
border-bottom:
|
|
91
|
+
var(--card-header-divider-width, 1rpx)
|
|
92
|
+
var(--card-header-divider-style, dashed)
|
|
93
|
+
var(--card-header-divider-color, var(--border-color, #e2e8f0));
|
|
94
|
+
}
|
|
82
95
|
}
|
|
83
96
|
|
|
84
97
|
.hlw-card-header__left {
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
|
|
14
14
|
<scroll-view
|
|
15
15
|
class="hlw-page-content"
|
|
16
|
-
:class="bodyClass"
|
|
17
|
-
:style="bodyStyle"
|
|
18
16
|
:scroll-y="true"
|
|
19
17
|
:enable-flex="true"
|
|
20
18
|
:enhanced="true"
|
|
21
19
|
:show-scrollbar="false"
|
|
22
20
|
>
|
|
23
|
-
<
|
|
21
|
+
<view class="hlw-page-body" :class="bodyClass" :style="bodyStyle">
|
|
22
|
+
<slot />
|
|
23
|
+
</view>
|
|
24
24
|
</scroll-view>
|
|
25
25
|
|
|
26
26
|
<view class="hlw-page-footer">
|
|
@@ -48,9 +48,12 @@ interface Props {
|
|
|
48
48
|
title?: string;
|
|
49
49
|
isBack?: boolean;
|
|
50
50
|
bgClass?: string;
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* 透传到 scroll-view 内层 view 包裹(不是 scroll-view 本身)的 class,常用于直接挂 .container。
|
|
53
|
+
* 用 view 包裹是因为 mp-weixin 的 scroll-view 是原生组件,flex/gap 行为跟普通 view 不一致。
|
|
54
|
+
*/
|
|
52
55
|
bodyClass?: ClassValue;
|
|
53
|
-
/**
|
|
56
|
+
/** 透传到内层 view 包裹的 style,规则同 bodyClass */
|
|
54
57
|
bodyStyle?: StyleValue;
|
|
55
58
|
}
|
|
56
59
|
|
|
@@ -84,6 +87,12 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
84
87
|
width: 100%;
|
|
85
88
|
}
|
|
86
89
|
|
|
90
|
+
.hlw-page-body {
|
|
91
|
+
width: 100%;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
}
|
|
95
|
+
|
|
87
96
|
.hlw-page-footer {
|
|
88
97
|
flex-shrink: 0;
|
|
89
98
|
}
|