muzhiyu-ui 1.0.6 → 1.0.10

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.
@@ -39,9 +39,9 @@
39
39
  </view>
40
40
 
41
41
  <!-- 按钮文本 -->
42
- <span v-if="hasLabel" class="mu-button__label">
42
+ <text v-if="hasLabel" class="mu-button__label">
43
43
  <slot></slot>
44
- </span>
44
+ </text>
45
45
 
46
46
  <!-- 右侧矢量图标 -->
47
47
  <view v-if="!loading && (icon || $slots.icon) && iconPosition === 'right'" class="mu-button__icon mu-button__icon--right">
@@ -61,6 +61,14 @@
61
61
  <script setup>
62
62
  import { computed, useSlots, inject } from 'vue'
63
63
 
64
+ defineOptions({
65
+ name: 'mu-button',
66
+ options: {
67
+ virtualHost: true,
68
+ styleIsolation: 'shared'
69
+ }
70
+ })
71
+
64
72
  const config = inject('muConfig', null)
65
73
 
66
74
  const props = defineProps({
@@ -270,21 +278,22 @@ function onChooseAvatar(e) { emit('chooseavatar', e) }
270
278
 
271
279
  &__inner {
272
280
  position: relative;
273
- display: inline-flex;
274
- align-items: center;
275
- justify-content: center;
276
- box-sizing: border-box;
281
+ display: inline-flex !important;
282
+ align-items: center !important;
283
+ justify-content: center !important;
284
+ box-sizing: border-box !important;
277
285
  white-space: nowrap;
278
286
  cursor: pointer;
279
287
  user-select: none;
280
288
  transition: all $mu-duration $mu-ease;
281
289
  border: none;
282
290
  outline: none;
283
- line-height: 1;
291
+ line-height: 1 !important;
292
+ margin: 0 !important;
284
293
 
285
294
  /* 微信小程序原生按钮重置 */
286
295
  &::after {
287
- display: none;
296
+ display: none !important;
288
297
  }
289
298
 
290
299
  &--active {
@@ -294,20 +303,20 @@ function onChooseAvatar(e) { emit('chooseavatar', e) }
294
303
  }
295
304
 
296
305
  &__label {
297
- display: inline-flex;
298
- align-items: center;
299
- justify-content: center;
300
- line-height: 1;
301
- vertical-align: middle;
306
+ display: inline-flex !important;
307
+ align-items: center !important;
308
+ justify-content: center !important;
309
+ line-height: 1 !important;
310
+ height: 100%;
302
311
  }
303
312
 
304
313
  &__icon {
305
- display: inline-flex;
306
- align-items: center;
307
- justify-content: center;
308
- line-height: 1;
314
+ display: inline-flex !important;
315
+ align-items: center !important;
316
+ justify-content: center !important;
317
+ line-height: 1 !important;
318
+ height: 100%;
309
319
  flex-shrink: 0;
310
- vertical-align: middle;
311
320
 
312
321
  &--left { margin-right: 8rpx; }
313
322
  &--right { margin-left: 8rpx; }
@@ -770,17 +770,15 @@ function handleClick(e) {
770
770
 
771
771
  <style lang="scss" scoped>
772
772
  .mu-icon {
773
- display: inline-flex;
774
- align-items: center;
775
- justify-content: center;
776
- line-height: 1;
773
+ display: inline-flex !important;
774
+ align-items: center !important;
775
+ justify-content: center !important;
776
+ vertical-align: middle !important;
777
+ line-height: 1 !important;
777
778
 
778
- &__svg {
779
- display: block;
780
- }
781
-
782
- &__image {
783
- display: block;
779
+ &__svg, &__image {
780
+ display: block !important;
781
+ margin: auto !important;
784
782
  }
785
783
 
786
784
  &__fallback {
@@ -37,7 +37,13 @@
37
37
  :value="innerValue" :placeholder="placeholder" :disabled="disabled" :maxlength="maxlength"
38
38
  :auto-height="autoHeight" @input="onInput" @focus="onFocus" @blur="onBlur" />
39
39
 
40
- <!-- 普通 / 数字 / 手机 / 密码 / 验证码 / 虚拟键盘 Input -->
40
+ <!-- 只读选择模式 (避免拉起系统软键盘) -->
41
+ <view v-if="readonly" class="mu-input__virtual-box">
42
+ <text v-if="innerValue !== undefined && innerValue !== null && String(innerValue).length > 0" class="mu-input__virtual-text">{{ innerValue }}</text>
43
+ <text v-else class="mu-input__virtual-placeholder">{{ placeholder }}</text>
44
+ </view>
45
+
46
+ <!-- 虚拟键盘 Input -->
41
47
  <view v-else-if="isVirtualKeyboardActive" class="mu-input__virtual-box">
42
48
  <text v-if="innerValue" class="mu-input__virtual-text">{{ innerValue }}</text>
43
49
  <text v-else class="mu-input__virtual-placeholder">{{ placeholder }}</text>
@@ -115,6 +121,7 @@ const props = defineProps({
115
121
  required: { type: Boolean, default: false }, // 是否显示必填红星 *
116
122
  placeholder: { type: String, default: '请输入' },
117
123
  disabled: { type: Boolean, default: false },
124
+ readonly: { type: Boolean, default: false },
118
125
  clearable: { type: Boolean, default: false },
119
126
  maxlength: { type: [Number, String], default: -1 },
120
127
  counter: { type: Boolean, default: false },
@@ -60,7 +60,11 @@ const pickerValue = ref([])
60
60
 
61
61
  function getItemLabel(item) {
62
62
  if (typeof item === 'object' && item !== null) {
63
- return (item[props.labelKey] !== undefined ? item[props.labelKey] : (item.label !== undefined ? item.label : String(item)))
63
+ if (props.labelKey && item[props.labelKey] !== undefined) return String(item[props.labelKey])
64
+ if (item.label !== undefined) return String(item.label)
65
+ if (item.text !== undefined) return String(item.text)
66
+ if (item.title !== undefined) return String(item.title)
67
+ if (item.name !== undefined) return String(item.name)
64
68
  }
65
69
  return String(item)
66
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muzhiyu-ui",
3
- "version": "1.0.6",
3
+ "version": "1.0.10",
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.6",
32
+ "version": "1.0.10",
33
33
  "description": "基于 UniApp Vue3 + SCSS 打造的全端极奢 UI 组件库",
34
34
  "site": "",
35
35
  "displayName": "MuzhiyuUI 极奢全端组件库"