当前位置:网站首页>El upload realizes the preview of uploaded files
El upload realizes the preview of uploaded files
2022-07-23 22:07:00 【Starry sky】
Element Official website el-upload File upload component , But there is no relevant function of file preview , However, sometimes the requirements need to meet the function of previewing after uploading files , So how to realize the right el-upload Preview the uploaded file ?
el-upload Component application
<el-upload class="upload-demo" ref="uploadFile" :auto-upload="false" :action="testForm.actionUrl" drag :file-list="testForm.fileList" :on-change="handleFileChange" :on-remove="removeFile" :limit="1" :on-exceed="overLimitCount" >
JS Function processing
handleFileChange(files, fileList) {
this.testForm.fileList = fileList
let reader = new FileReader()
reader.readAsText(files.raw)
reader.onload = e => {
this.testForm.fileContent = e.target.result.replace(
/\n|\r\n/g,
'<br/>'
)
}
},
Dialog Preview file
<el-button type="primary" @click="isShow = true" > File preview </el-button >
<el-dialog title=" File preview " :visible="isShow" @close="isShow = false" width="40%" append-to-body >
<div v-html="testForm.fileContent"></div>
</el-dialog>
边栏推荐
- el-select下拉框多选远程搜索反显
- 02. Supplement of knowledge related to web page structure
- Cesium core class viewer viewer details
- 如何彻底强制杀死后台无关进程?
- Sixty final review questions of software architecture
- Openlayers instances advanced mapbox vector tiles advanced mapbox vector maps
- Comment forcer complètement le meurtre de processus indépendants de l'arrière - plan?
- 数据库系统概论第五版课后习题——第一章 绪论
- Lambda learning (the use of comparator after sort and collectors.groupingby after collection)
- [hiflow] Tencent cloud's new generation of automation assistant, which I used to complete the enterprise epidemic prompt (no code)
猜你喜欢

Neo4j application

jedis 6---redisson和jedis的入门和不同

Preliminary discussion on POC compilation

Apprentissage Lambda (utilisation du comparateur après tri, regroupement après collecte avec collectors.groupingby)

Application of performance test knowledge to actual combat

【golang学习笔记】Go语言中参数的传递是值传递还是引用传递

Openlayers instance advanced view positioning advanced view positioning

JS - event proxy and application scenarios

lambda学习(sort后面的Comparator的使用,collection后使用Collectors.groupingBy分组)

What are the product life cycle, common project functions, and information flow
随机推荐
Distributed transaction scheme: best effort notification scheme
10 basic written interview questions, how many questions can you answer?
NLP field history most complete must read classic papers classification, sorting and sharing (with Chinese analysis)
二分函数细节
-2021 sorting and sharing of the latest required papers related to comparative learning
STM32单片机使用ADC功能驱动手指检测心跳模块
Openlayers instance accessible map accessible map
PCL出错:error C2589“(“:“::“右边的非法标记)
MySQL的JDBC编程
ESP32 的 I2C 原理 & 应用入门
Sixty final review questions of software architecture
Explain NAT technology in detail
如何彻底强制杀死后台无关进程?
LeetCode高频题53. 最大子数组和,具有最大和的连续子数组,返回其最大和
DBSCAN点云聚类
达梦数据库tools包中的工具(操作达梦数据库)
JMeter performance comprehensive practice - sign in and batch sign in
【数学建模暑期培训】配送中心选址问题
Altium Designer - schematic diagram of Arduino uno & PCB diagram (self-made Arduino board)
JDBC programming of MySQL