随笔分类 -  elementUI

elementUI 在mocktable数据时注意事项
摘要:在模拟table数据时注意prop关联不能用数字作为标记,会报,t.replace is undefined 阅读全文

posted @ 2021-07-21 15:17 html123 阅读(66) 评论(0) 推荐(0)

element-ui的table,切换左侧树数据替换后高度变小问题
摘要:页面结构为左侧是树,右侧是表格,当切换左侧树时候,右侧表格数据改变,但是表格高度会变小,网上找的两种解决方法 方法一: 在表格数据改变后执行: this.$nextTick(() =>{ 表格加上ref='table' this.$refs.table.doLayout() }) 方法二: 1.固定 阅读全文

posted @ 2020-12-18 11:30 html123 阅读(380) 评论(0) 推荐(0)

el-table设置默认选中
摘要:// 初始设置选中 toggleSelection(rows) { if (rows) { rows.forEach(row => { this.$refs.table.toggleRowSelection(row); }); } } rows传入选中项的集合 阅读全文

posted @ 2020-12-09 13:48 html123 阅读(5597) 评论(0) 推荐(0)

Element 的Table组件判断当前是勾选还是取消勾选
摘要:在el-table上绑定@select=tableSelect事件,methods方法: tableSelect(rows, row) { let selected = rows.length && rows.indexOf(row) !== -1 console.log(selected) // 阅读全文

posted @ 2020-12-09 13:44 html123 阅读(2628) 评论(0) 推荐(0)