element-ui上传一张图片后隐藏上传按钮
2024-09-15 20:56:07
来自:https://github.com/ElemeFE/element/issues/3367#issuecomment-376402380 侵删
el-upload里面绑定一个占位class:
:class="{hide:hideUpload}"
data里面初始值:
hideUpload: false,
limitCount:1
onChange里面(添加文件、上传成功和上传失败时都会被调用的那个):
this.hideUpload = fileList.length >= this.limitCount;
handleRemove里面(删除文件被调用的那个):
this.hideUpload = fileList.length >= this.limitCount;
style,把scoped去掉(或者外部引入样式文件,主要目的是为了修改element-ui自带的样式)
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>
最新文章
- 记一次log4j日志文件输出错误的解决
- C# HTTP上传文件
- LeetCode #303. Range Sum Query
- 0050 Linux VIM 命令
- SURF算法与源码分析、上
- Shell | grep with n following lines
- JS全局变量VAR和THIS
- C++类的大小
- jquery第一期:运行第一个jquery
- CSharp设计模式读书笔记(6):建造者模式(学习难度:★★★★☆,使用频率:★★☆☆☆)
- Collection和Map
- java 中 printf()语句的理解
- Storm入门(二)集群环境安装
- python基础概念(转)
- JavaScript判断苹果 iPhone X Series 机型
- jQuery汇总
- 80端口被占用 导致apach无法启动问题
- PGSQL 获取数据库大小以及表达小等的SQL
- Android Sensor——传感器
- GMM实战
热门文章
- flutter SnackBar 底部消息提示
- Sword cjson库函数使用
- matlab基本函数randperm end数组索引
- 报错:Sqoop2 Error message: Class not found JDBC Driver Class: com.mysql.jdbc.Driver
- Python - Django - 添加首页尾页上一页下一页
- AI佳作解读系列(六) - 生成对抗网络(GAN)综述精华
- jenkins安装插件一直不动
- Golang中的Map(集合)
- 13点睛Spring4.1-Spring EL
- linux如何找回已经删除的文件?lsof