im-ui-mobile 0.1.17 → 0.1.19

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.
@@ -45,7 +45,7 @@
45
45
  </template>
46
46
 
47
47
  <script setup lang="ts">
48
- import { ref, computed, watch, nextTick, useSlots } from 'vue'
48
+ import { ref, computed, watch } from 'vue'
49
49
  import ImCell from '../im-cell/im-cell.vue'
50
50
 
51
51
  // 定义 Props 接口
@@ -519,6 +519,11 @@ const startUpload = async (uploadFile: UploadFile) => {
519
519
  throw new Error('请设置上传地址或自定义上传函数')
520
520
  }
521
521
 
522
+ // 服务端失败
523
+ if (response.statusCode !== 200) {
524
+ throw new Error(response.data.error.message)
525
+ }
526
+
522
527
  // 格式化响应数据
523
528
  const formattedResponse = props.responseFormatter(response)
524
529
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "im-ui-mobile",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "A Vue3.0 + Typescript instant messaging component library for Uniapp",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -86,9 +86,6 @@ declare interface UploadProps {
86
86
 
87
87
  // 上传组件方法
88
88
  declare interface UploadMethods {
89
- // 手动上传文件
90
- upload: (file: Object) => Promise<void>
91
-
92
89
  // 清空文件列表
93
90
  clearFiles: () => void
94
91
 
@@ -110,15 +107,14 @@ declare interface _Upload {
110
107
  'update:modelValue': (files: UploadFile[]) => void
111
108
  'change': (files: UploadFile[]) => void
112
109
  'select': (file: Object) => void
113
- 'upload': (file: UploadFile) => void
114
110
  'success': (response: any, file: UploadFile) => void
115
111
  'error': (error: Error, file: UploadFile) => void
116
112
  'progress': (percent: number, file: UploadFile) => void
117
113
  'remove': (file: UploadFile, index: number) => void
118
114
  'preview': (file: UploadFile) => void
119
115
  'exceed': (files: Object[]) => void
120
- 'before-upload': (file: UploadFile) => void
121
- 'after-upload': (file: UploadFile) => void
116
+ 'uploading': (file: UploadFile) => void
117
+ 'uploaded': (file: UploadFile) => void
122
118
  }
123
119
  } & UploadMethods
124
120
  }