<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>