[Bug Report] Table in tabs, tabs in dialog, when tabs switches to non table, closes dialog, opens dialog again and modifies table data, table disappears
Element UI version
1.4.3
OS/Browsers version
win7/chrome60
Vue version
2.4.2
Reproduction Link
https://jsfiddle.net/forgiver/1rcjo1rq/1/
Steps to reproduce
See the connection for specific steps.
What is Expected?
Table normal display.
What is actually happening?
Table disappears under certain circumstances.
I found that if you have a Table in a Dialog, when table is not visible, change the data that your Table required, show the Dialog again, the Table disappears~
Yes,the problem is it~
I found,because the table add a className el-table-hidden,so table is disappered,but I don't know why
i override el-table-hidden in css to force display show .... 0.0
@element-bot ...
Same problem here...
Found a solution to my problem.
<el-table ref="orderTable" :data="goodInCart" style="width: 100%" height="300">
<el-table-column label="商品" prop="goodName"></el-table-column>
<el-table-column label="价格" prop="price"></el-table-column>
<el-table-column label="数量" prop="stock"></el-table-column>
</el-table>
added ref to the table and used ref to re-run method doLayOut() after the dialog has been shown.
handleCheckout(){
this.checkoutVisible = true;
this.$nextTick(() =>{
this.goodInOrder = [];
this.goodInOrder = this.goodInCart.map(item => ({
goodId: item.goodId,
goodName: item.goodName,
goodDesc: item.goodDesc,
price: item.price,
stock: item.stock,
createAt: item.createAt,
updateAt: item.updateAt,
}));
this.$refs.orderTable.doLayout();
});
me too
Fixed in 2.0: https://jsfiddle.net/1rcjo1rq/3/
@Leopoldthecoder 有没有临时解决方案?非要升级到2.0吗?
@linda8167 上面 doLayout 的解决方案应该是可行的
固定表头的表格 v-show切换显示 但是table的高度会发生变化
固定表头的表格 v-show切换显示 但是table的高度会发生变化