muzhiyu-ui 1.0.14 → 1.0.16

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.
@@ -5,8 +5,7 @@
5
5
  hover-class="mu-button__inner--active"
6
6
  :hover-stay-time="150"
7
7
  :style="innerStyle"
8
- :disabled="disabled"
9
- :loading="loading"
8
+ :disabled="disabled || loading"
10
9
  :form-type="formType"
11
10
  :open-type="openType"
12
11
  :lang="lang"
@@ -39,6 +39,7 @@ function show(arg1, arg2) {
39
39
  currentPosition.value = props.position || 'center'
40
40
  currentDuration.value = props.duration || 2000
41
41
  } else if (arg1 && typeof arg1 === 'object') {
42
+ arg1._handled = true
42
43
  currentTitle.value = arg1.title || props.title || ''
43
44
  currentType.value = arg1.type || props.type || 'default'
44
45
  currentPosition.value = arg1.position || props.position || 'center'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muzhiyu-ui",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
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.14",
32
+ "version": "1.0.16",
33
33
  "description": "基于 UniApp Vue3 + SCSS 打造的全端极奢 UI 组件库",
34
34
  "site": "",
35
35
  "displayName": "MuzhiyuUI 极奢全端组件库"
package/utils/index.js CHANGED
@@ -201,6 +201,17 @@ export const util = {
201
201
 
202
202
  // 发射全局事件触发页面挂载的 <mu-toast> 组件
203
203
  uni.$emit('mu-toast-show', payload)
204
+
205
+ // 智能降级机制:若页面未添加 <mu-toast> 节点,自动回退渲染原生 uni.showToast
206
+ setTimeout(() => {
207
+ if (!payload._handled) {
208
+ uni.showToast({
209
+ title: payload.title,
210
+ icon: payload.type === 'success' ? 'success' : 'none',
211
+ duration: payload.duration || 2000
212
+ })
213
+ }
214
+ }, 10)
204
215
  },
205
216
 
206
217
  /**