element-ui中table表头表格错误问题解决
2024-10-19 01:20:48
我用的是element-ui v1.4.3
在iframe关闭和切换导航会引起有table的表格错位,解决办法:
handleAdminNavTab: function(tab) {
var adminContent = this.$el.querySelector('.sc-admin__content__bd');
var iframes = adminContent.querySelectorAll('iframe');
this.$nextTick(function() {
var url = 'projectController';
iframes = Array.prototype.slice.call(iframes);
iframes.forEach(function(iframe) {
if (iframe.src.indexOf(url) !== -1) {
var vm = iframe.contentWindow.vm;
if (vm && vm.$refs) {
//刷新表格布局
vm.$refs.table && vm.$refs.table.doLayout();
}
}
});
});
}
主要是调用: vm.$refs.table && vm.$refs.table.doLayout();
记录下renderCell的用法(与上文问题无关):
{ label: '批注项', prop: 'commentItem' ,align:"center" , minWidth:"200",renderCell:function(h,scope){
return h('div',{domProps:{
innerHTML:scope.row.commentItem
}})
}},
最新文章
- C++中的 :: 用法
- WebApi系列~StringContent参数需要添加MetaType对象
- 统计";1";个数问题
- Android Studio 修改 包名 package name
- Discuz!X3.1 全新安装图文教程
- hdu1043Eight (经典的八数码)(康托展开+BFS)
- 『软件介绍』SQLServer2008 基本操作
- Struct和Class的区别
- flume-采集报错
- Extjs2.0 desktop 动态创建桌面图标和开始菜单
- [转载]mysql创建临时表,将查询结果插入已有表中
- 强大的IDEA开发工具
- python一个命令开启http服务器
- js实现点击按钮复制文本功能
- python中执行该文件,就调用 mian 方法
- netty03(基于4.1.23.Final 版本的案例)
- bootstrap-treeview 中文开发手册
- week_one-python格式化输出
- post请求参数设置
- html中title属性换行实现
热门文章
- Go语言常量
- [CocoaPods]使用Gemfile
- HttpRunner框架(一)
- Python——collections模块
- [EXP]Drupal <; 8.5.11 / <; 8.6.10 - RESTful Web Services unserialize() Remote Command Execution (Metasploit)
- 课程四(Convolutional Neural Networks),第三 周(Object detection) —— 0.Learning Goals
- Python 解析har 文件将域名分类导出
- ClickHouse之集群搭建以及数据复制
- Java并发编程笔记之StampedLock锁源码探究
- MYSQL中的COLLATE是什么?