rexma-design 1.1.2 → 1.1.3
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.
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
</block>
|
|
20
20
|
<block v-else>
|
|
21
21
|
<wd-icon name="add" size="40rpx" color="#999"></wd-icon>
|
|
22
|
-
<text class="xh-upload-title">{{
|
|
22
|
+
<text class="xh-upload-title">{{ uploadTip }}</text>
|
|
23
23
|
</block>
|
|
24
24
|
</block>
|
|
25
25
|
</view>
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup lang="ts">
|
|
29
|
-
import { ref } from 'vue';
|
|
29
|
+
import { ref, computed } from 'vue';
|
|
30
30
|
|
|
31
|
-
import type
|
|
31
|
+
import { type UploadType, type IModelValue, uploadTypeTextMap } from './declaration';
|
|
32
32
|
import xh from '../../utils/xh';
|
|
33
33
|
import XinhuaClient from '../../utils/XinhuaClient';
|
|
34
34
|
import { clientChooseFile } from './utils';
|
|
@@ -56,13 +56,22 @@ type IXhUploadProps = {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
const props = withDefaults(defineProps<IXhUploadProps>(), {
|
|
59
|
-
title: '上传图片',
|
|
60
59
|
acceptFileType: () => 'image',
|
|
61
60
|
requestSign: true,
|
|
62
61
|
});
|
|
63
62
|
const emit = defineEmits(['update:modelValue']);
|
|
64
63
|
// 上传状态
|
|
65
64
|
const uploading = ref(false);
|
|
65
|
+
const uploadTip = computed(() => {
|
|
66
|
+
if (props.title) {
|
|
67
|
+
return props.title;
|
|
68
|
+
}
|
|
69
|
+
if (typeof props.acceptFileType === 'string') {
|
|
70
|
+
return `上传${uploadTypeTextMap.get(props.acceptFileType)}`;
|
|
71
|
+
}
|
|
72
|
+
// todo: acceptFileType 配置非字符串时所展示的文案
|
|
73
|
+
return '';
|
|
74
|
+
});
|
|
66
75
|
|
|
67
76
|
/**
|
|
68
77
|
* @description 点击上传卡片
|