@hlw-uni/mp-vue 1.0.16 → 1.0.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/dist/index.js CHANGED
@@ -299,11 +299,14 @@
299
299
  }
300
300
  });
301
301
  const index$3 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-14242381"]]);
302
- const _hoisted_1$2 = { class: "hlw-menu" };
303
- const _hoisted_2$2 = {
302
+ const _hoisted_1$2 = {
304
303
  key: 0,
305
304
  class: "hlw-menu-title"
306
305
  };
306
+ const _hoisted_2$2 = {
307
+ key: 1,
308
+ class: "hlw-menu-title-divider"
309
+ };
307
310
  const _hoisted_3$2 = { class: "hlw-menu-left" };
308
311
  const _hoisted_4$1 = { class: "hlw-menu-label" };
309
312
  const _hoisted_5$1 = { class: "hlw-menu-right" };
@@ -330,7 +333,8 @@
330
333
  items: {},
331
334
  title: { default: "" },
332
335
  mode: { default: "list" },
333
- columns: { default: 4 }
336
+ columns: { default: 4 },
337
+ border: { type: Boolean, default: true }
334
338
  },
335
339
  emits: ["click"],
336
340
  setup(__props, { emit: __emit }) {
@@ -342,11 +346,14 @@
342
346
  };
343
347
  return (_ctx, _cache) => {
344
348
  const _component_navigator = vue.resolveComponent("navigator");
345
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$2, [
346
- props.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$2, [
349
+ return vue.openBlock(), vue.createElementBlock("view", {
350
+ class: vue.normalizeClass(["hlw-menu", { "hlw-menu--no-border": !props.border }])
351
+ }, [
352
+ props.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$2, [
347
353
  vue.createElementVNode("text", null, vue.toDisplayString(props.title), 1)
348
354
  ])) : vue.createCommentVNode("", true),
349
- props.mode === "list" ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(visibleItems.value, (item, index2) => {
355
+ props.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$2)) : vue.createCommentVNode("", true),
356
+ props.mode === "list" ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(visibleItems.value, (item, index2) => {
350
357
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
351
358
  item.url ? (vue.openBlock(), vue.createBlock(_component_navigator, {
352
359
  key: 0,
@@ -402,7 +409,7 @@
402
409
  index2 < visibleItems.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_11)) : vue.createCommentVNode("", true)
403
410
  ], 64);
404
411
  }), 128)) : (vue.openBlock(), vue.createElementBlock("view", {
405
- key: 2,
412
+ key: 3,
406
413
  class: "hlw-menu-grid",
407
414
  style: vue.normalizeStyle({ gridTemplateColumns: `repeat(${props.columns}, 1fr)` })
408
415
  }, [
@@ -455,11 +462,11 @@
455
462
  ], 64);
456
463
  }), 128))
457
464
  ], 4))
458
- ]);
465
+ ], 2);
459
466
  };
460
467
  }
461
468
  });
462
- const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3081ac3b"]]);
469
+ const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-728f18f4"]]);
463
470
  const _hoisted_1$1 = { class: "hlw-menu-list" };
464
471
  const _hoisted_2$1 = ["onTap"];
465
472
  const _hoisted_3$1 = { class: "hlw-menu-list__left" };
package/dist/index.mjs CHANGED
@@ -296,11 +296,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
296
296
  }
297
297
  });
298
298
  const index$3 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-14242381"]]);
299
- const _hoisted_1$2 = { class: "hlw-menu" };
300
- const _hoisted_2$2 = {
299
+ const _hoisted_1$2 = {
301
300
  key: 0,
302
301
  class: "hlw-menu-title"
303
302
  };
303
+ const _hoisted_2$2 = {
304
+ key: 1,
305
+ class: "hlw-menu-title-divider"
306
+ };
304
307
  const _hoisted_3$2 = { class: "hlw-menu-left" };
305
308
  const _hoisted_4$1 = { class: "hlw-menu-label" };
306
309
  const _hoisted_5$1 = { class: "hlw-menu-right" };
@@ -327,7 +330,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
327
330
  items: {},
328
331
  title: { default: "" },
329
332
  mode: { default: "list" },
330
- columns: { default: 4 }
333
+ columns: { default: 4 },
334
+ border: { type: Boolean, default: true }
331
335
  },
332
336
  emits: ["click"],
333
337
  setup(__props, { emit: __emit }) {
@@ -339,11 +343,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
339
343
  };
340
344
  return (_ctx, _cache) => {
341
345
  const _component_navigator = resolveComponent("navigator");
342
- return openBlock(), createElementBlock("view", _hoisted_1$2, [
343
- props.title ? (openBlock(), createElementBlock("view", _hoisted_2$2, [
346
+ return openBlock(), createElementBlock("view", {
347
+ class: normalizeClass(["hlw-menu", { "hlw-menu--no-border": !props.border }])
348
+ }, [
349
+ props.title ? (openBlock(), createElementBlock("view", _hoisted_1$2, [
344
350
  createElementVNode("text", null, toDisplayString(props.title), 1)
345
351
  ])) : createCommentVNode("", true),
346
- props.mode === "list" ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(visibleItems.value, (item, index2) => {
352
+ props.title ? (openBlock(), createElementBlock("view", _hoisted_2$2)) : createCommentVNode("", true),
353
+ props.mode === "list" ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(visibleItems.value, (item, index2) => {
347
354
  return openBlock(), createElementBlock(Fragment, { key: index2 }, [
348
355
  item.url ? (openBlock(), createBlock(_component_navigator, {
349
356
  key: 0,
@@ -399,7 +406,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
399
406
  index2 < visibleItems.value.length - 1 ? (openBlock(), createElementBlock("view", _hoisted_11)) : createCommentVNode("", true)
400
407
  ], 64);
401
408
  }), 128)) : (openBlock(), createElementBlock("view", {
402
- key: 2,
409
+ key: 3,
403
410
  class: "hlw-menu-grid",
404
411
  style: normalizeStyle({ gridTemplateColumns: `repeat(${props.columns}, 1fr)` })
405
412
  }, [
@@ -452,11 +459,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
452
459
  ], 64);
453
460
  }), 128))
454
461
  ], 4))
455
- ]);
462
+ ], 2);
456
463
  };
457
464
  }
458
465
  });
459
- const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3081ac3b"]]);
466
+ const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-728f18f4"]]);
460
467
  const _hoisted_1$1 = { class: "hlw-menu-list" };
461
468
  const _hoisted_2$1 = ["onTap"];
462
469
  const _hoisted_3$1 = { class: "hlw-menu-list__left" };
package/dist/style.css CHANGED
@@ -145,71 +145,79 @@ to { transform: rotate(360deg);
145
145
  color: #999;
146
146
  }
147
147
 
148
- .hlw-menu[data-v-3081ac3b] {
148
+ .hlw-menu[data-v-728f18f4] {
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-728f18f4] {
156
+ border: none;
157
+ }
155
158
 
156
159
  /* 标题 */
157
- .hlw-menu-title[data-v-3081ac3b] {
160
+ .hlw-menu-title[data-v-728f18f4] {
158
161
  padding: 24rpx 32rpx 0;
159
162
  }
160
- .hlw-menu-title text[data-v-3081ac3b] {
163
+ .hlw-menu-title text[data-v-728f18f4] {
161
164
  font-size: 24rpx;
162
165
  font-weight: 600;
163
166
  color: #94a3b8;
164
167
  letter-spacing: 1rpx;
165
168
  }
169
+ .hlw-menu-title-divider[data-v-728f18f4] {
170
+ margin: 16rpx 32rpx 0;
171
+ height: 0;
172
+ border-bottom: 1rpx dashed var(--border-color, #e2e8f0);
173
+ }
166
174
 
167
175
  /* ========== 列表模式 ========== */
168
- .hlw-menu-item[data-v-3081ac3b] {
176
+ .hlw-menu-item[data-v-728f18f4] {
169
177
  display: flex;
170
178
  align-items: center;
171
179
  justify-content: space-between;
172
180
  padding: 24rpx 32rpx;
173
181
  }
174
- .hlw-menu-item--active[data-v-3081ac3b] {
182
+ .hlw-menu-item--active[data-v-728f18f4] {
175
183
  background: #f8fafc;
176
184
  }
177
- .hlw-menu-divider[data-v-3081ac3b] {
185
+ .hlw-menu-divider[data-v-728f18f4] {
178
186
  margin: 0 32rpx;
179
187
  height: 0;
180
188
  border-bottom: 1rpx dashed var(--border-color, #e2e8f0);
181
189
  }
182
- .hlw-menu-left[data-v-3081ac3b] {
190
+ .hlw-menu-left[data-v-728f18f4] {
183
191
  display: flex;
184
192
  align-items: center;
185
193
  gap: 24rpx;
186
194
  }
187
- .hlw-menu-right[data-v-3081ac3b] {
195
+ .hlw-menu-right[data-v-728f18f4] {
188
196
  display: flex;
189
197
  align-items: center;
190
198
  gap: 16rpx;
191
199
  }
192
200
 
193
201
  /* ========== 宫格模式 ========== */
194
- .hlw-menu-grid[data-v-3081ac3b] {
202
+ .hlw-menu-grid[data-v-728f18f4] {
195
203
  display: grid;
196
204
  padding: 16rpx 0 24rpx;
197
205
  }
198
- .hlw-menu-grid-item[data-v-3081ac3b] {
206
+ .hlw-menu-grid-item[data-v-728f18f4] {
199
207
  display: flex;
200
208
  flex-direction: column;
201
209
  align-items: center;
202
210
  gap: 12rpx;
203
211
  padding: 16rpx 8rpx;
204
212
  }
205
- .hlw-menu-grid-item--active[data-v-3081ac3b] {
213
+ .hlw-menu-grid-item--active[data-v-728f18f4] {
206
214
  background: #f8fafc;
207
215
  }
208
- .hlw-menu-grid-icon-wrap[data-v-3081ac3b] {
216
+ .hlw-menu-grid-icon-wrap[data-v-728f18f4] {
209
217
  position: relative;
210
218
  padding-top: 20rpx; /* 预留徽标空间,保证所有格子图标水平对齐 */
211
219
  }
212
- .hlw-menu-badge[data-v-3081ac3b] {
220
+ .hlw-menu-badge[data-v-728f18f4] {
213
221
  position: absolute;
214
222
  top: 0;
215
223
  right: -8rpx;
@@ -222,14 +230,14 @@ to { transform: rotate(360deg);
222
230
  line-height: 28rpx;
223
231
  height: 28rpx;
224
232
  }
225
- .hlw-menu-grid-label[data-v-3081ac3b] {
233
+ .hlw-menu-grid-label[data-v-728f18f4] {
226
234
  font-size: 24rpx;
227
235
  color: #334155;
228
236
  text-align: center;
229
237
  }
230
238
 
231
239
  /* ========== 图标 ========== */
232
- .hlw-menu-icon[data-v-3081ac3b] {
240
+ .hlw-menu-icon[data-v-728f18f4] {
233
241
  width: 64rpx;
234
242
  height: 64rpx;
235
243
  border-radius: var(--radius-md, 16rpx);
@@ -238,86 +246,86 @@ to { transform: rotate(360deg);
238
246
  justify-content: center;
239
247
  flex-shrink: 0;
240
248
  }
241
- .hlw-menu-icon text[data-v-3081ac3b] {
249
+ .hlw-menu-icon text[data-v-728f18f4] {
242
250
  font-size: 20rpx;
243
251
  }
244
- .hlw-menu-icon--grid[data-v-3081ac3b] {
252
+ .hlw-menu-icon--grid[data-v-728f18f4] {
245
253
  width: 88rpx;
246
254
  height: 88rpx;
247
255
  border-radius: var(--radius-lg, 24rpx);
248
256
  }
249
- .hlw-menu-icon--grid text[data-v-3081ac3b] {
257
+ .hlw-menu-icon--grid text[data-v-728f18f4] {
250
258
  font-size: 32rpx;
251
259
  }
252
- .hlw-menu-icon--orange[data-v-3081ac3b] {
260
+ .hlw-menu-icon--orange[data-v-728f18f4] {
253
261
  background: #fff7ed;
254
262
  color: #f97316;
255
263
  }
256
- .hlw-menu-icon--purple[data-v-3081ac3b] {
264
+ .hlw-menu-icon--purple[data-v-728f18f4] {
257
265
  background: #faf5ff;
258
266
  color: #a855f7;
259
267
  }
260
- .hlw-menu-icon--wechat[data-v-3081ac3b] {
268
+ .hlw-menu-icon--wechat[data-v-728f18f4] {
261
269
  background: #f0fdf4;
262
270
  color: #07c160;
263
271
  }
264
- .hlw-menu-icon--cyan[data-v-3081ac3b] {
272
+ .hlw-menu-icon--cyan[data-v-728f18f4] {
265
273
  background: #ecfeff;
266
274
  color: #06b6d4;
267
275
  }
268
- .hlw-menu-icon--emerald[data-v-3081ac3b] {
276
+ .hlw-menu-icon--emerald[data-v-728f18f4] {
269
277
  background: #ecfdf5;
270
278
  color: #10b981;
271
279
  }
272
- .hlw-menu-icon--slate[data-v-3081ac3b] {
280
+ .hlw-menu-icon--slate[data-v-728f18f4] {
273
281
  background: #f1f5f9;
274
282
  color: #64748b;
275
283
  }
276
- .hlw-menu-icon--rose[data-v-3081ac3b] {
284
+ .hlw-menu-icon--rose[data-v-728f18f4] {
277
285
  background: #fff1f2;
278
286
  color: #f43f5e;
279
287
  }
280
- .hlw-menu-icon--blue[data-v-3081ac3b] {
288
+ .hlw-menu-icon--blue[data-v-728f18f4] {
281
289
  background: #eff6ff;
282
290
  color: #3b82f6;
283
291
  }
284
- .hlw-menu-icon--red[data-v-3081ac3b] {
292
+ .hlw-menu-icon--red[data-v-728f18f4] {
285
293
  background: #fef2f2;
286
294
  color: #ef4444;
287
295
  }
288
296
 
289
297
  /* ========== 标签 / 角标 ========== */
290
- .hlw-menu-label[data-v-3081ac3b] {
298
+ .hlw-menu-label[data-v-728f18f4] {
291
299
  font-size: 28rpx;
292
300
  font-weight: 500;
293
301
  color: #334155;
294
302
  }
295
- .hlw-menu-tag[data-v-3081ac3b] {
303
+ .hlw-menu-tag[data-v-728f18f4] {
296
304
  font-size: 20rpx;
297
305
  color: #fff;
298
306
  padding: 2rpx 12rpx;
299
307
  border-radius: 9999rpx;
300
308
  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
301
309
  }
302
- .hlw-menu-tag--orange[data-v-3081ac3b] {
310
+ .hlw-menu-tag--orange[data-v-728f18f4] {
303
311
  background: #fb923c;
304
312
  }
305
- .hlw-menu-tag--red[data-v-3081ac3b] {
313
+ .hlw-menu-tag--red[data-v-728f18f4] {
306
314
  background: #ef4444;
307
315
  }
308
- .hlw-menu-tag--wechat[data-v-3081ac3b] {
316
+ .hlw-menu-tag--wechat[data-v-728f18f4] {
309
317
  background: #07c160;
310
318
  }
311
- .hlw-menu-tag--rose[data-v-3081ac3b] {
319
+ .hlw-menu-tag--rose[data-v-728f18f4] {
312
320
  background: #f43f5e;
313
321
  }
314
- .hlw-menu-tag--blue[data-v-3081ac3b] {
322
+ .hlw-menu-tag--blue[data-v-728f18f4] {
315
323
  background: #3b82f6;
316
324
  }
317
- .hlw-menu-tag-pulse[data-v-3081ac3b] {
318
- animation: tag-pulse-3081ac3b 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
325
+ .hlw-menu-tag-pulse[data-v-728f18f4] {
326
+ animation: tag-pulse-728f18f4 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
319
327
  }
320
- @keyframes tag-pulse-3081ac3b {
328
+ @keyframes tag-pulse-728f18f4 {
321
329
  0%, 100% {
322
330
  opacity: 1;
323
331
  }
@@ -325,18 +333,18 @@ to { transform: rotate(360deg);
325
333
  opacity: 0.5;
326
334
  }
327
335
  }
328
- .hlw-menu-arrow[data-v-3081ac3b] {
336
+ .hlw-menu-arrow[data-v-728f18f4] {
329
337
  color: #d1d5db;
330
338
  font-size: 20rpx;
331
339
  }
332
- .hlw-menu-spin[data-v-3081ac3b] {
333
- animation: icon-spin-3081ac3b 1s linear infinite;
340
+ .hlw-menu-spin[data-v-728f18f4] {
341
+ animation: icon-spin-728f18f4 1s linear infinite;
334
342
  }
335
- .hlw-menu-muted[data-v-3081ac3b] {
343
+ .hlw-menu-muted[data-v-728f18f4] {
336
344
  color: #94a3b8;
337
345
  font-size: 20rpx;
338
346
  }
339
- @keyframes icon-spin-3081ac3b {
347
+ @keyframes icon-spin-728f18f4 {
340
348
  from {
341
349
  transform: rotate(0deg);
342
350
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hlw-uni/mp-vue",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "hlw-uni Vue 组件库 — 供小程序业务方使用的 UI 组件集合",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1,9 +1,10 @@
1
1
  <template>
2
- <view class="hlw-menu">
2
+ <view class="hlw-menu" :class="{ 'hlw-menu--no-border': !props.border }">
3
3
  <!-- 标题 -->
4
4
  <view v-if="props.title" class="hlw-menu-title">
5
5
  <text>{{ props.title }}</text>
6
6
  </view>
7
+ <view v-if="props.title" class="hlw-menu-title-divider"></view>
7
8
 
8
9
  <!-- 列表模式 -->
9
10
  <template v-if="props.mode === 'list'">
@@ -79,12 +80,15 @@ interface Props {
79
80
  mode?: "list" | "grid";
80
81
  /** 宫格列数,默认 4 */
81
82
  columns?: number;
83
+ /** 是否显示外边框,默认 true */
84
+ border?: boolean;
82
85
  }
83
86
 
84
87
  const props = withDefaults(defineProps<Props>(), {
85
88
  title: "",
86
89
  mode: "list",
87
90
  columns: 4,
91
+ border: true,
88
92
  });
89
93
 
90
94
  const emit = defineEmits<{
@@ -105,6 +109,10 @@ const handleClick = (item: HlwMenuItem) => {
105
109
  border: 1rpx solid var(--border-color, #e2e8f0);
106
110
  overflow: hidden;
107
111
  width: 100%;
112
+
113
+ &--no-border {
114
+ border: none;
115
+ }
108
116
  }
109
117
 
110
118
  /* 标题 */
@@ -118,6 +126,12 @@ const handleClick = (item: HlwMenuItem) => {
118
126
  }
119
127
  }
120
128
 
129
+ .hlw-menu-title-divider {
130
+ margin: 16rpx 32rpx 0;
131
+ height: 0;
132
+ border-bottom: 1rpx dashed var(--border-color, #e2e8f0);
133
+ }
134
+
121
135
  /* ========== 列表模式 ========== */
122
136
  .hlw-menu-item {
123
137
  display: flex;