[issue/455]上传组件传入accept限制上传文件类型无效
parent
ccbdd0cf6d
commit
f48e1125d0
|
@ -2,6 +2,7 @@
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<a-upload
|
<a-upload
|
||||||
:listType="listType"
|
:listType="listType"
|
||||||
|
accept="image/*"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
:action="uploadUrl"
|
:action="uploadUrl"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, computed, watch, nextTick, createApp } from 'vue';
|
import { ref, reactive, computed, watch, nextTick, createApp,unref } from 'vue';
|
||||||
import { Icon } from '/@/components/Icon';
|
import { Icon } from '/@/components/Icon';
|
||||||
import { getToken } from '/@/utils/auth';
|
import { getToken } from '/@/utils/auth';
|
||||||
import { uploadUrl } from '/@/api/common/api';
|
import { uploadUrl } from '/@/api/common/api';
|
||||||
|
@ -82,7 +82,10 @@
|
||||||
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
|
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
|
||||||
// 合并 props 和 attrs
|
// 合并 props 和 attrs
|
||||||
const bindProps = computed(() => {
|
const bindProps = computed(() => {
|
||||||
const bind: any = Object.assign({}, props, attrs);
|
//update-begin-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
||||||
|
const bind: any = Object.assign({}, props, unref(attrs));
|
||||||
|
//update-end-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
||||||
|
|
||||||
bind.name = 'file';
|
bind.name = 'file';
|
||||||
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
||||||
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
||||||
|
|
Loading…
Reference in New Issue