首页
关于
壁纸
留言板
友链
更多
洛尘首页
Search
1
vueA页面调用B页面的函数
562 阅读
2
el-select加一个全选功能
484 阅读
3
Vue限制输入框内容只能输入金额或数字
456 阅读
4
控制富文本中图片大小
428 阅读
5
14个适合后台管理系统快速开发的前端框架
352 阅读
vue
vue2
vue3
webpack
node
登录
Search
标签搜索
webpack
Luochen
累计撰写
12
篇文章
累计收到
3
条评论
首页
栏目
vue
vue2
vue3
webpack
node
页面
关于
壁纸
留言板
友链
推荐
洛尘首页
搜索到
1
篇与
vue2
的结果
2022-07-23
el-select加一个全选功能
html部分<el-select v-model="ruleForm.staff_attendance_name" clearable multiple placeholder="请选择" @change="selectAll" @remove-tag="removeTag"> <el-option label="全选" value="全选" ></el-option> <el-option v-if="ruleForm.staff_attendance_name!=['全选']" v-for="item in attendanceTeamInfo" :key="item.name" :label="item.name" :value="item.name"> </el-option> </el-select>js部分//考勤地点点击全选 selectAll(val) { var inx=val.findIndex(item=>item=='全选'); if(this.allCheck&&inx>-1){ //如果是全选,并且剩余的数组里有全选,就把全选删了 if(inx>-1){ val.splice(inx,1) } this.allCheck=false; }else{ if(inx>-1){ this.allCheck=true; var arr=['全选']; this.attendanceTeamInfo.forEach(ele=>{ arr.push(ele.name); this.ruleForm.staff_attendance_name=arr; }) }else if(val.length==this.attendanceTeamInfo.length&&this.allCheck){ this.ruleForm.staff_attendance_name=[]; this.allCheck=false; }else if(val.length==this.attendanceTeamInfo.length){ this.allCheck=true; this.ruleForm.staff_attendance_name.unshift('全选') } } }, //移除全选时,清空选项 removeTag(val){ if(val=='全选'){ this.ruleForm.staff_attendance_name=[] } },
2022年07月23日
484 阅读
2 评论
0 点赞