element icon indicating copy to clipboard operation
element copied to clipboard

[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

Open JinboMa opened this issue 9 years ago • 13 comments

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.

JinboMa avatar Sep 01 '17 07:09 JinboMa

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~

GodayMax avatar Sep 02 '17 04:09 GodayMax

Yes,the problem is it~

JinboMa avatar Sep 02 '17 05:09 JinboMa

I found,because the table add a className el-table-hidden,so table is disappered,but I don't know why

JinboMa avatar Sep 02 '17 05:09 JinboMa

i override el-table-hidden in css to force display show .... 0.0

spx443812507 avatar Sep 07 '17 02:09 spx443812507

@element-bot ...

JinboMa avatar Sep 18 '17 03:09 JinboMa

Same problem here...

atticusmiles avatar Oct 16 '17 15:10 atticusmiles

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();
    });

atticusmiles avatar Oct 16 '17 15:10 atticusmiles

me too

linda8167 avatar Oct 23 '17 11:10 linda8167

Fixed in 2.0: https://jsfiddle.net/1rcjo1rq/3/

Leopoldthecoder avatar Oct 23 '17 11:10 Leopoldthecoder

@Leopoldthecoder 有没有临时解决方案?非要升级到2.0吗?

linda8167 avatar Oct 23 '17 13:10 linda8167

@linda8167 上面 doLayout 的解决方案应该是可行的

Leopoldthecoder avatar Oct 23 '17 15:10 Leopoldthecoder

固定表头的表格 v-show切换显示 但是table的高度会发生变化

liuquanzhang avatar Apr 26 '20 10:04 liuquanzhang

固定表头的表格 v-show切换显示 但是table的高度会发生变化

liuquanzhang avatar Apr 26 '20 10:04 liuquanzhang