@hlw-uni/mp-vue 1.0.20 → 1.0.22

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/dist/style.css CHANGED
@@ -145,78 +145,78 @@ to { transform: rotate(360deg);
145
145
  color: #999;
146
146
  }
147
147
 
148
- .hlw-menu[data-v-2fb4d4c7] {
148
+ .hlw-menu[data-v-1e8beec7] {
149
149
  background: #fff;
150
150
  border-radius: var(--radius-lg, 24rpx);
151
151
  border: 1rpx solid var(--border-color, #e2e8f0);
152
152
  overflow: hidden;
153
153
  width: 100%;
154
154
  }
155
- .hlw-menu--no-border[data-v-2fb4d4c7] {
155
+ .hlw-menu--no-border[data-v-1e8beec7] {
156
156
  border: none;
157
157
  }
158
158
 
159
159
  /* 标题 */
160
- .hlw-menu-title[data-v-2fb4d4c7] {
160
+ .hlw-menu-title[data-v-1e8beec7] {
161
161
  padding: 24rpx 32rpx;
162
162
  }
163
- .hlw-menu-title text[data-v-2fb4d4c7] {
163
+ .hlw-menu-title text[data-v-1e8beec7] {
164
164
  font-size: 24rpx;
165
165
  font-weight: 600;
166
166
  color: #94a3b8;
167
167
  letter-spacing: 1rpx;
168
168
  }
169
- .hlw-menu-title-divider[data-v-2fb4d4c7] {
169
+ .hlw-menu-title-divider[data-v-1e8beec7] {
170
170
  height: 0;
171
171
  border-bottom: 1rpx dashed var(--border-color, #e2e8f0);
172
172
  }
173
173
 
174
174
  /* ========== 列表模式 ========== */
175
- .hlw-menu-item[data-v-2fb4d4c7] {
175
+ .hlw-menu-item[data-v-1e8beec7] {
176
176
  display: flex;
177
177
  align-items: center;
178
178
  justify-content: space-between;
179
179
  padding: 24rpx 32rpx;
180
180
  }
181
- .hlw-menu-item--active[data-v-2fb4d4c7] {
181
+ .hlw-menu-item--active[data-v-1e8beec7] {
182
182
  background: #f8fafc;
183
183
  }
184
- .hlw-menu-divider[data-v-2fb4d4c7] {
184
+ .hlw-menu-divider[data-v-1e8beec7] {
185
185
  margin: 0 32rpx;
186
186
  height: 0;
187
187
  border-bottom: 1rpx dashed var(--border-color, #e2e8f0);
188
188
  }
189
- .hlw-menu-left[data-v-2fb4d4c7] {
189
+ .hlw-menu-left[data-v-1e8beec7] {
190
190
  display: flex;
191
191
  align-items: center;
192
192
  gap: 24rpx;
193
193
  }
194
- .hlw-menu-right[data-v-2fb4d4c7] {
194
+ .hlw-menu-right[data-v-1e8beec7] {
195
195
  display: flex;
196
196
  align-items: center;
197
197
  gap: 16rpx;
198
198
  }
199
199
 
200
200
  /* ========== 宫格模式 ========== */
201
- .hlw-menu-grid[data-v-2fb4d4c7] {
201
+ .hlw-menu-grid[data-v-1e8beec7] {
202
202
  display: grid;
203
203
  padding: 6rpx 0 24rpx;
204
204
  }
205
- .hlw-menu-grid-item[data-v-2fb4d4c7] {
205
+ .hlw-menu-grid-item[data-v-1e8beec7] {
206
206
  display: flex;
207
207
  flex-direction: column;
208
208
  align-items: center;
209
209
  gap: 10rpx;
210
210
  padding: 12rpx 8rpx;
211
211
  }
212
- .hlw-menu-grid-item--active[data-v-2fb4d4c7] {
212
+ .hlw-menu-grid-item--active[data-v-1e8beec7] {
213
213
  background: #f8fafc;
214
214
  }
215
- .hlw-menu-grid-icon-wrap[data-v-2fb4d4c7] {
215
+ .hlw-menu-grid-icon-wrap[data-v-1e8beec7] {
216
216
  position: relative;
217
217
  padding-top: 20rpx; /* 预留徽标空间,保证所有格子图标水平对齐 */
218
218
  }
219
- .hlw-menu-badge[data-v-2fb4d4c7] {
219
+ .hlw-menu-badge[data-v-1e8beec7] {
220
220
  position: absolute;
221
221
  top: 0;
222
222
  right: -8rpx;
@@ -229,14 +229,14 @@ to { transform: rotate(360deg);
229
229
  line-height: 28rpx;
230
230
  height: 28rpx;
231
231
  }
232
- .hlw-menu-grid-label[data-v-2fb4d4c7] {
232
+ .hlw-menu-grid-label[data-v-1e8beec7] {
233
233
  font-size: 24rpx;
234
234
  color: #334155;
235
235
  text-align: center;
236
236
  }
237
237
 
238
238
  /* ========== 图标 ========== */
239
- .hlw-menu-icon[data-v-2fb4d4c7] {
239
+ .hlw-menu-icon[data-v-1e8beec7] {
240
240
  width: 64rpx;
241
241
  height: 64rpx;
242
242
  border-radius: var(--radius-md, 16rpx);
@@ -245,86 +245,90 @@ to { transform: rotate(360deg);
245
245
  justify-content: center;
246
246
  flex-shrink: 0;
247
247
  }
248
- .hlw-menu-icon text[data-v-2fb4d4c7] {
248
+ .hlw-menu-icon text[data-v-1e8beec7] {
249
249
  font-size: 20rpx;
250
250
  }
251
- .hlw-menu-icon--grid[data-v-2fb4d4c7] {
251
+ .hlw-menu-icon--grid[data-v-1e8beec7] {
252
252
  width: 88rpx;
253
253
  height: 88rpx;
254
254
  border-radius: var(--radius-lg, 24rpx);
255
255
  }
256
- .hlw-menu-icon--grid text[data-v-2fb4d4c7] {
256
+ .hlw-menu-icon--grid text[data-v-1e8beec7] {
257
257
  font-size: 32rpx;
258
258
  }
259
- .hlw-menu-icon--orange[data-v-2fb4d4c7] {
259
+ .hlw-menu-icon--orange[data-v-1e8beec7] {
260
260
  background: #fff7ed;
261
261
  color: #f97316;
262
262
  }
263
- .hlw-menu-icon--purple[data-v-2fb4d4c7] {
263
+ .hlw-menu-icon--purple[data-v-1e8beec7] {
264
264
  background: #faf5ff;
265
265
  color: #a855f7;
266
266
  }
267
- .hlw-menu-icon--wechat[data-v-2fb4d4c7] {
267
+ .hlw-menu-icon--wechat[data-v-1e8beec7] {
268
268
  background: #f0fdf4;
269
269
  color: #07c160;
270
270
  }
271
- .hlw-menu-icon--cyan[data-v-2fb4d4c7] {
271
+ .hlw-menu-icon--cyan[data-v-1e8beec7] {
272
272
  background: #ecfeff;
273
273
  color: #06b6d4;
274
274
  }
275
- .hlw-menu-icon--emerald[data-v-2fb4d4c7] {
275
+ .hlw-menu-icon--emerald[data-v-1e8beec7] {
276
276
  background: #ecfdf5;
277
277
  color: #10b981;
278
278
  }
279
- .hlw-menu-icon--slate[data-v-2fb4d4c7] {
279
+ .hlw-menu-icon--slate[data-v-1e8beec7] {
280
280
  background: #f1f5f9;
281
281
  color: #64748b;
282
282
  }
283
- .hlw-menu-icon--rose[data-v-2fb4d4c7] {
283
+ .hlw-menu-icon--rose[data-v-1e8beec7] {
284
284
  background: #fff1f2;
285
285
  color: #f43f5e;
286
286
  }
287
- .hlw-menu-icon--blue[data-v-2fb4d4c7] {
287
+ .hlw-menu-icon--blue[data-v-1e8beec7] {
288
288
  background: #eff6ff;
289
289
  color: #3b82f6;
290
290
  }
291
- .hlw-menu-icon--red[data-v-2fb4d4c7] {
291
+ .hlw-menu-icon--red[data-v-1e8beec7] {
292
292
  background: #fef2f2;
293
293
  color: #ef4444;
294
294
  }
295
295
 
296
296
  /* ========== 标签 / 角标 ========== */
297
- .hlw-menu-label[data-v-2fb4d4c7] {
297
+ .hlw-menu-label[data-v-1e8beec7] {
298
298
  font-size: 28rpx;
299
299
  font-weight: 500;
300
300
  color: #334155;
301
301
  }
302
- .hlw-menu-tag[data-v-2fb4d4c7] {
302
+ .hlw-menu-value[data-v-1e8beec7] {
303
+ font-size: 26rpx;
304
+ color: #94a3b8;
305
+ }
306
+ .hlw-menu-tag[data-v-1e8beec7] {
303
307
  font-size: 20rpx;
304
308
  color: #fff;
305
309
  padding: 2rpx 12rpx;
306
310
  border-radius: 9999rpx;
307
311
  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
308
312
  }
309
- .hlw-menu-tag--orange[data-v-2fb4d4c7] {
313
+ .hlw-menu-tag--orange[data-v-1e8beec7] {
310
314
  background: #fb923c;
311
315
  }
312
- .hlw-menu-tag--red[data-v-2fb4d4c7] {
316
+ .hlw-menu-tag--red[data-v-1e8beec7] {
313
317
  background: #ef4444;
314
318
  }
315
- .hlw-menu-tag--wechat[data-v-2fb4d4c7] {
319
+ .hlw-menu-tag--wechat[data-v-1e8beec7] {
316
320
  background: #07c160;
317
321
  }
318
- .hlw-menu-tag--rose[data-v-2fb4d4c7] {
322
+ .hlw-menu-tag--rose[data-v-1e8beec7] {
319
323
  background: #f43f5e;
320
324
  }
321
- .hlw-menu-tag--blue[data-v-2fb4d4c7] {
325
+ .hlw-menu-tag--blue[data-v-1e8beec7] {
322
326
  background: #3b82f6;
323
327
  }
324
- .hlw-menu-tag-pulse[data-v-2fb4d4c7] {
325
- animation: tag-pulse-2fb4d4c7 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
328
+ .hlw-menu-tag-pulse[data-v-1e8beec7] {
329
+ animation: tag-pulse-1e8beec7 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
326
330
  }
327
- @keyframes tag-pulse-2fb4d4c7 {
331
+ @keyframes tag-pulse-1e8beec7 {
328
332
  0%, 100% {
329
333
  opacity: 1;
330
334
  }
@@ -332,69 +336,25 @@ to { transform: rotate(360deg);
332
336
  opacity: 0.5;
333
337
  }
334
338
  }
335
- .hlw-menu-arrow[data-v-2fb4d4c7] {
339
+ .hlw-menu-arrow[data-v-1e8beec7] {
336
340
  color: #d1d5db;
337
341
  font-size: 20rpx;
338
342
  }
339
- .hlw-menu-spin[data-v-2fb4d4c7] {
340
- animation: icon-spin-2fb4d4c7 1s linear infinite;
343
+ .hlw-menu-spin[data-v-1e8beec7] {
344
+ animation: icon-spin-1e8beec7 1s linear infinite;
341
345
  }
342
- .hlw-menu-muted[data-v-2fb4d4c7] {
346
+ .hlw-menu-muted[data-v-1e8beec7] {
343
347
  color: #94a3b8;
344
348
  font-size: 20rpx;
345
349
  }
346
- @keyframes icon-spin-2fb4d4c7 {
350
+ @keyframes icon-spin-1e8beec7 {
347
351
  from {
348
352
  transform: rotate(0deg);
349
353
  }
350
354
  to {
351
355
  transform: rotate(360deg);
352
356
  }
353
- }
354
- .hlw-menu-list[data-v-e465b0b4] {
355
- background: #fff;
356
- border-radius: 16rpx;
357
- overflow: hidden;
358
- }
359
- .hlw-menu-list__item[data-v-e465b0b4] {
360
- display: flex;
361
- align-items: center;
362
- justify-content: space-between;
363
- padding: 28rpx 32rpx;
364
- border-bottom: 1rpx solid #f5f5f5;
365
- }
366
- .hlw-menu-list__item[data-v-e465b0b4]:last-child {
367
- border-bottom: none;
368
- }
369
- .hlw-menu-list__left[data-v-e465b0b4] {
370
- display: flex;
371
- align-items: center;
372
- gap: 16rpx;
373
- }
374
- .hlw-menu-list__icon[data-v-e465b0b4] {
375
- font-size: 36rpx;
376
- width: 44rpx;
377
- text-align: center;
378
- }
379
- .hlw-menu-list__label[data-v-e465b0b4] {
380
- font-size: 30rpx;
381
- color: #333;
382
- }
383
- .hlw-menu-list__right[data-v-e465b0b4] {
384
- display: flex;
385
- align-items: center;
386
- gap: 8rpx;
387
- }
388
- .hlw-menu-list__value[data-v-e465b0b4] {
389
- font-size: 28rpx;
390
- color: #999;
391
- }
392
- .hlw-menu-list__arrow[data-v-e465b0b4] {
393
- font-size: 36rpx;
394
- color: #ccc;
395
- line-height: 1;
396
- }
397
- .hlw-page[data-v-155bc02a] {
357
+ }.hlw-page[data-v-155bc02a] {
398
358
  width: 100%;
399
359
  height: 100vh;
400
360
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hlw-uni/mp-vue",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "hlw-uni Vue 组件库 — 供小程序业务方使用的 UI 组件集合",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -17,6 +17,7 @@
17
17
  <text class="hlw-menu-label">{{ item.label }}</text>
18
18
  </view>
19
19
  <view class="hlw-menu-right">
20
+ <text v-if="item.value" class="hlw-menu-value">{{ item.value }}</text>
20
21
  <text v-if="item.tag" class="hlw-menu-tag" :class="[`hlw-menu-tag--${item.tagTheme || 'rose'}`, item.tagPulse ? 'hlw-menu-tag-pulse' : '']">{{ item.tag }}</text>
21
22
  <text class="i-fa6-solid-chevron-right hlw-menu-arrow"></text>
22
23
  </view>
@@ -31,6 +32,7 @@
31
32
  </view>
32
33
  <view class="hlw-menu-right">
33
34
  <text v-if="item.loading" class="i-fa6-solid-circle-notch hlw-menu-spin hlw-menu-muted"></text>
35
+ <text v-if="item.value" class="hlw-menu-value">{{ item.value }}</text>
34
36
  <text v-if="item.tag" class="hlw-menu-tag" :class="[`hlw-menu-tag--${item.tagTheme || 'rose'}`, item.tagPulse ? 'hlw-menu-tag-pulse' : '']">{{ item.tag }}</text>
35
37
  <text class="i-fa6-solid-chevron-right hlw-menu-arrow"></text>
36
38
  </view>
@@ -272,6 +274,11 @@ const handleClick = (item: HlwMenuItem) => {
272
274
  color: #334155;
273
275
  }
274
276
 
277
+ .hlw-menu-value {
278
+ font-size: 26rpx;
279
+ color: #94a3b8;
280
+ }
281
+
275
282
  .hlw-menu-tag {
276
283
  font-size: 20rpx;
277
284
  color: #fff;
@@ -10,6 +10,8 @@ export interface HlwMenuItem {
10
10
  label: string;
11
11
  /** 跳转路径,有值则用 navigator 包裹 */
12
12
  url?: string;
13
+ /** 右侧纯文字说明(列表模式),如版本号、状态文字 */
14
+ value?: string;
13
15
  /** 右侧标签文字(列表模式)/ 角标文字(宫格模式) */
14
16
  tag?: string;
15
17
  /** 标签主题色 */
package/src/index.ts CHANGED
@@ -2,14 +2,12 @@
2
2
  * @hlw-uni/mp-vue — Vue 组件库统一导出
3
3
  */
4
4
 
5
- export { default as HlwAd } from './components/hlw-ad/index.vue';
6
- export { default as HlwAvatar } from './components/hlw-avatar/index.vue';
7
- export { default as HlwCard } from './components/hlw-card/index.vue';
8
- export { default as HlwEmpty } from './components/hlw-empty/index.vue';
9
- export { default as HlwHeader } from './components/hlw-header/index.vue';
10
- export { default as HlwLoading } from './components/hlw-loading/index.vue';
11
- export { default as HlwMenu } from './components/hlw-menu/index.vue';
12
- export type { HlwMenuItem } from './components/hlw-menu/types';
13
- export { default as HlwMenuList } from './components/hlw-menu-list/index.vue';
14
- export { default as HlwPage } from './components/hlw-page/index.vue';
15
- export type { MenuItem } from './components/hlw-menu-list/types';
5
+ export { default as HlwAd } from "./components/hlw-ad/index.vue";
6
+ export { default as HlwAvatar } from "./components/hlw-avatar/index.vue";
7
+ export { default as HlwCard } from "./components/hlw-card/index.vue";
8
+ export { default as HlwEmpty } from "./components/hlw-empty/index.vue";
9
+ export { default as HlwHeader } from "./components/hlw-header/index.vue";
10
+ export { default as HlwLoading } from "./components/hlw-loading/index.vue";
11
+ export { default as HlwMenu } from "./components/hlw-menu/index.vue";
12
+ export type { HlwMenuItem } from "./components/hlw-menu/types";
13
+ export { default as HlwPage } from "./components/hlw-page/index.vue";
@@ -1,8 +0,0 @@
1
- export interface MenuItem {
2
- key: string;
3
- label: string;
4
- icon?: string;
5
- value?: string;
6
- url?: string;
7
- action?: () => void;
8
- }
@@ -1,94 +0,0 @@
1
- <template>
2
- <view class="hlw-menu-list">
3
- <view
4
- v-for="item in items"
5
- :key="item.key"
6
- class="hlw-menu-list__item"
7
- @tap="onTap(item)"
8
- >
9
- <view class="hlw-menu-list__left">
10
- <text v-if="item.icon" class="hlw-menu-list__icon">{{ item.icon }}</text>
11
- <text class="hlw-menu-list__label">{{ item.label }}</text>
12
- </view>
13
- <view class="hlw-menu-list__right">
14
- <text v-if="item.value" class="hlw-menu-list__value">{{ item.value }}</text>
15
- <text class="hlw-menu-list__arrow">›</text>
16
- </view>
17
- </view>
18
- </view>
19
- </template>
20
-
21
- <script setup lang="ts">
22
- import type { MenuItem } from './types';
23
-
24
- const props = defineProps<{
25
- items: MenuItem[];
26
- }>();
27
-
28
- const emit = defineEmits<{
29
- (e: 'click', item: MenuItem): void;
30
- }>();
31
-
32
- function onTap(item: MenuItem) {
33
- if (item.url) {
34
- uni.navigateTo({ url: item.url });
35
- } else if (item.action) {
36
- item.action();
37
- }
38
- emit('click', item);
39
- }
40
- </script>
41
-
42
- <style scoped>
43
- .hlw-menu-list {
44
- background: #fff;
45
- border-radius: 16rpx;
46
- overflow: hidden;
47
- }
48
-
49
- .hlw-menu-list__item {
50
- display: flex;
51
- align-items: center;
52
- justify-content: space-between;
53
- padding: 28rpx 32rpx;
54
- border-bottom: 1rpx solid #f5f5f5;
55
- }
56
-
57
- .hlw-menu-list__item:last-child {
58
- border-bottom: none;
59
- }
60
-
61
- .hlw-menu-list__left {
62
- display: flex;
63
- align-items: center;
64
- gap: 16rpx;
65
- }
66
-
67
- .hlw-menu-list__icon {
68
- font-size: 36rpx;
69
- width: 44rpx;
70
- text-align: center;
71
- }
72
-
73
- .hlw-menu-list__label {
74
- font-size: 30rpx;
75
- color: #333;
76
- }
77
-
78
- .hlw-menu-list__right {
79
- display: flex;
80
- align-items: center;
81
- gap: 8rpx;
82
- }
83
-
84
- .hlw-menu-list__value {
85
- font-size: 28rpx;
86
- color: #999;
87
- }
88
-
89
- .hlw-menu-list__arrow {
90
- font-size: 36rpx;
91
- color: #ccc;
92
- line-height: 1;
93
- }
94
- </style>
@@ -1,8 +0,0 @@
1
- export interface MenuItem {
2
- key: string;
3
- label: string;
4
- icon?: string;
5
- value?: string;
6
- url?: string;
7
- action?: () => void;
8
- }