Commit aae78193 authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Table: hide table when nested in an invisible container

parent 7fa29675
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
'el-table--fit': fit, 'el-table--fit': fit,
'el-table--striped': stripe, 'el-table--striped': stripe,
'el-table--border': border, 'el-table--border': border,
'el-table--hidden': isHidden,
'el-table--fluid-height': maxHeight, 'el-table--fluid-height': maxHeight,
'el-table--enable-row-hover': !store.states.isComplex, 'el-table--enable-row-hover': !store.states.isComplex,
'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100 'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
...@@ -291,6 +292,9 @@ ...@@ -291,6 +292,9 @@
} else if (this.shouldUpdateHeight) { } else if (this.shouldUpdateHeight) {
this.layout.updateHeight(); this.layout.updateHeight();
} }
if (this.$el) {
this.isHidden = this.$el.clientWidth === 0;
}
}); });
} }
}, },
...@@ -451,6 +455,7 @@ ...@@ -451,6 +455,7 @@
return { return {
store, store,
layout, layout,
isHidden: false,
renderExpanded: null, renderExpanded: null,
resizeProxyVisible: false resizeProxyVisible: false
}; };
......
...@@ -146,6 +146,10 @@ ...@@ -146,6 +146,10 @@
} }
} }
@modifier hidden {
visibility: hidden;
}
& th { & th {
background-color: var(--table-header-background); background-color: var(--table-header-background);
text-align: left; text-align: left;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment