review:【antd/ele】【mp】代码迁移的 review
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { UploadProps, UploadRawFile } from 'element-plus';
|
||||
import type { UploadProps } from 'element-plus';
|
||||
|
||||
import type { UploadData } from './upload';
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
|
||||
const props = defineProps<{ type: UploadType }>();
|
||||
|
||||
// TODO @dylan:是不是要和 antd 的 props 定义相同哈?这样后续两侧维护方便点
|
||||
const emit = defineEmits<{
|
||||
uploaded: [v: void];
|
||||
}>();
|
||||
@@ -59,6 +60,7 @@ const customRequest: UploadProps['httpRequest'] = async function (options) {
|
||||
|
||||
if (res.code !== 0) {
|
||||
ElMessage.error(`上传出错:${res.msg}`);
|
||||
// TODO @dylan:这里有个 linter 错误。
|
||||
onError?.(new Error(res.msg));
|
||||
return;
|
||||
}
|
||||
@@ -104,4 +106,3 @@ const customRequest: UploadProps['httpRequest'] = async function (options) {
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user