muzhiyu-ui 1.0.4 → 1.0.6

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.
@@ -196,7 +196,14 @@ const buttonClass = computed(() => [
196
196
 
197
197
  const wrapStyle = computed(() => {
198
198
  const style = {}
199
- if (props.block) style.width = '100%'
199
+ if (props.block) {
200
+ style.width = '100%'
201
+ style.display = 'block'
202
+ } else if (props.width) {
203
+ style.width = '100%'
204
+ style.display = 'flex'
205
+ style.justifyContent = 'center'
206
+ }
200
207
  if (props.margin) style.margin = props.margin
201
208
  return style
202
209
  })
@@ -290,7 +297,8 @@ function onChooseAvatar(e) { emit('chooseavatar', e) }
290
297
  display: inline-flex;
291
298
  align-items: center;
292
299
  justify-content: center;
293
- line-height: 1.2;
300
+ line-height: 1;
301
+ vertical-align: middle;
294
302
  }
295
303
 
296
304
  &__icon {
@@ -299,6 +307,7 @@ function onChooseAvatar(e) { emit('chooseavatar', e) }
299
307
  justify-content: center;
300
308
  line-height: 1;
301
309
  flex-shrink: 0;
310
+ vertical-align: middle;
302
311
 
303
312
  &--left { margin-right: 8rpx; }
304
313
  &--right { margin-left: 8rpx; }
@@ -401,7 +410,7 @@ function onChooseAvatar(e) { emit('chooseavatar', e) }
401
410
  }
402
411
  }
403
412
 
404
- .mu-dark, page.mu-dark {
413
+ .mu-dark {
405
414
  .mu-button {
406
415
  &--default &__inner {
407
416
  background: rgba(36, 36, 50, 0.9);
@@ -28,7 +28,7 @@
28
28
  </view>
29
29
 
30
30
  <!-- 中间标题与副说明 -->
31
- <view class="mu-cell__content">
31
+ <view class="mu-cell__content" :style="contentStyle">
32
32
  <view class="mu-cell__title">
33
33
  <slot><text class="mu-cell__title-text">{{ title }}</text></slot>
34
34
  </view>
@@ -38,12 +38,12 @@
38
38
  </view>
39
39
 
40
40
  <!-- 右侧自定义插槽 (支持绑定/授权手机号按钮、开关、文案等) -->
41
- <view class="mu-cell__right" @tap.stop>
41
+ <view class="mu-cell__right">
42
42
  <slot name="right">
43
43
  <slot name="value">
44
44
  <text v-if="value" class="mu-cell__value">{{ value }}</text>
45
45
  </slot>
46
- <view v-if="arrow" class="mu-cell__arrow" @tap="handleClick">
46
+ <view v-if="computedArrow" class="mu-cell__arrow">
47
47
  <mu-icon name="chevron_right" :size="16" color="#94A3B8" />
48
48
  </view>
49
49
  </slot>
@@ -75,11 +75,13 @@ import { ref, computed } from 'vue'
75
75
  const props = defineProps({
76
76
  title: { type: String, default: '' },
77
77
  label: { type: String, default: '' },
78
- value: { type: String, default: '' },
78
+ value: { type: [String, Number], default: '' },
79
+ titleWidth: { type: [String, Number], default: '' }, // 支持自定义标题固定宽度,如 '180rpx'
79
80
  icon: { type: String, default: '' },
80
81
  iconSize: { type: [Number, String], default: 20 },
81
82
  iconColor: { type: String, default: '' },
82
83
  arrow: { type: Boolean, default: false },
84
+ isLink: { type: Boolean, default: false },
83
85
  disabled: { type: Boolean, default: false },
84
86
  required: { type: Boolean, default: false },
85
87
  divider: { type: Boolean, default: true },
@@ -97,6 +99,20 @@ const props = defineProps({
97
99
 
98
100
  const emit = defineEmits(['click', 'click-swipe', 'delete'])
99
101
 
102
+ const contentStyle = computed(() => {
103
+ if (props.titleWidth) {
104
+ const w = typeof props.titleWidth === 'number' ? `${props.titleWidth}rpx` : props.titleWidth
105
+ return {
106
+ width: w,
107
+ flexShrink: 0,
108
+ flexGrow: 0
109
+ }
110
+ }
111
+ return {}
112
+ })
113
+
114
+ const computedArrow = computed(() => props.arrow || props.isLink)
115
+
100
116
  const touchStartX = ref(0)
101
117
  const touchStartY = ref(0)
102
118
  const swipeOffset = ref(0)
@@ -231,10 +247,11 @@ function handleClick(e) {
231
247
  &--disabled { opacity: 0.45; pointer-events: none; }
232
248
  &--center .mu-cell__body { align-items: center; }
233
249
 
234
- &--required .mu-cell__title-text::before {
250
+ /* 必填红星号后置 */
251
+ &--required .mu-cell__title-text::after {
235
252
  content: '*';
236
- color: $mu-danger;
237
- margin-right: 6rpx;
253
+ color: #ef4444;
254
+ margin-left: 4rpx;
238
255
  font-size: 26rpx;
239
256
  font-weight: 700;
240
257
  }
@@ -291,8 +308,10 @@ function handleClick(e) {
291
308
  &__right {
292
309
  display: flex;
293
310
  align-items: center;
311
+ justify-content: flex-end;
294
312
  margin-left: 20rpx;
295
- flex-shrink: 0;
313
+ flex: 1; /* 自动填满右侧剩余宽度 */
314
+ min-width: 0;
296
315
  }
297
316
 
298
317
  &__value {
@@ -344,7 +363,7 @@ function handleClick(e) {
344
363
  }
345
364
  }
346
365
 
347
- .mu-dark, page.mu-dark {
366
+ .mu-dark {
348
367
 
349
368
  .mu-cell {
350
369
  background: $mu-dark-bg-base;
@@ -789,7 +789,7 @@ function handleClick(e) {
789
789
  }
790
790
  }
791
791
 
792
- .mu-dark, page.mu-dark {
792
+ .mu-dark {
793
793
 
794
794
  .mu-icon {
795
795
  &__svg {
@@ -7,12 +7,12 @@
7
7
  error && 'mu-input--error',
8
8
  filled && 'mu-input--filled'
9
9
  ]">
10
- <!-- 标题 Label (包含必填红星与位置布局) -->
10
+ <!-- 标题 Label (必填红星号后置) -->
11
11
  <view v-if="label || $slots.label" class="mu-input__label-box" :style="labelBoxStyle">
12
- <text v-if="required" class="mu-input__required">*</text>
13
12
  <slot name="label">
14
13
  <text class="mu-input__label-text">{{ label }}</text>
15
14
  </slot>
15
+ <text v-if="required" class="mu-input__required" style="color: #ef4444; margin-left: 4rpx;">*</text>
16
16
  </view>
17
17
 
18
18
  <!-- 输入框主容器 Main Box -->
@@ -116,7 +116,7 @@ const props = defineProps({
116
116
  placeholder: { type: String, default: '请输入' },
117
117
  disabled: { type: Boolean, default: false },
118
118
  clearable: { type: Boolean, default: false },
119
- maxlength: { type: Number, default: -1 },
119
+ maxlength: { type: [Number, String], default: -1 },
120
120
  counter: { type: Boolean, default: false },
121
121
  autoHeight: { type: Boolean, default: false },
122
122
  error: { type: Boolean, default: false },
@@ -540,7 +540,7 @@ defineExpose({
540
540
  }
541
541
  }
542
542
 
543
- .mu-dark, page.mu-dark {
543
+ .mu-dark {
544
544
 
545
545
  .mu-input {
546
546
  &__label-text { color: $mu-dark-text-primary; }
@@ -80,7 +80,7 @@ const props = defineProps({
80
80
  title: { type: String, default: '' },
81
81
  value: { type: String, default: '' },
82
82
  mode: { type: String, default: 'number' }, // number | idcard | car
83
- maxlength: { type: Number, default: 0 },
83
+ maxlength: { type: [Number, String], default: 0 },
84
84
  decimal: { type: Boolean, default: false },
85
85
  showToolbar: { type: Boolean, default: true },
86
86
  extraKey: { type: String, default: '' }
@@ -355,7 +355,7 @@ watch(() => props.value, (val) => {
355
355
  }
356
356
  }
357
357
 
358
- .mu-dark, page.mu-dark {
358
+ .mu-dark {
359
359
  .mu-keyboard {
360
360
  &__panel {
361
361
  background: #0F172A;
@@ -271,7 +271,7 @@ watch(() => props.show, (val) => {
271
271
  }
272
272
  }
273
273
 
274
- .mu-dark, page.mu-dark {
274
+ .mu-dark {
275
275
 
276
276
  .mu-picker {
277
277
  &__mask { background: rgba(0, 0, 0, 0.65); }
@@ -269,7 +269,7 @@ defineExpose({ close: handleClose, open: () => { visible.value = true } })
269
269
  }
270
270
  }
271
271
 
272
- .mu-dark, page.mu-dark {
272
+ .mu-dark {
273
273
 
274
274
  .mu-popup {
275
275
  &__content {
@@ -42,6 +42,14 @@
42
42
  <script setup>
43
43
  import { computed } from 'vue'
44
44
 
45
+ defineOptions({
46
+ name: 'mu-section',
47
+ options: {
48
+ virtualHost: true,
49
+ styleIsolation: 'shared'
50
+ }
51
+ })
52
+
45
53
  const props = defineProps({
46
54
  title: { type: String, default: '' },
47
55
  desc: { type: String, default: '' },
@@ -186,7 +194,7 @@ function handleRightClick(e) {
186
194
  }
187
195
  }
188
196
 
189
- .mu-dark, page.mu-dark {
197
+ .mu-dark {
190
198
 
191
199
  .mu-section {
192
200
  &__title { color: $mu-dark-text-primary; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muzhiyu-ui",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "基于 UniApp Vue3 + SCSS 打造的全端极奢组件库",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "uni_modules": {
30
30
  "id": "muzhiyu-ui",
31
31
  "name": "muzhiyu-ui 极奢组件库",
32
- "version": "1.0.4",
32
+ "version": "1.0.6",
33
33
  "description": "基于 UniApp Vue3 + SCSS 打造的全端极奢 UI 组件库",
34
34
  "site": "",
35
35
  "displayName": "MuzhiyuUI 极奢全端组件库"