<el-upload class="upload-demo" action multiple :file-list="contractList" disabled>
<template #file="{file}">
<div>
<el-tooltip :content="file.name" placement="top">
<el-button type="text" class="file-name" @click="handlePreview(file)">{{ file.name }}</el-button>
</el-tooltip>
</div>
</template>
</el-upload>
//预览文件(导出)
handlePreview (file) {
let link = document.createElement('a');
link.style.display = 'none';
link.href = file.url;
window.open(link.href,'_blank');
},
//样式
<style scoped>
.file-name {
display: inline-block;//
max-width: 120px;//显示最大宽度
white-space: nowrap;//不换行
overflow: hidden;//超出隐藏
text-overflow: ellipsis;//超出的三个点替换
}
</style>
10-11
1万+
1万+

被折叠的 条评论
为什么被折叠?



