Element: [Bug Report] el-table-column unusual behavior with v-if or v-show

Created on 5 Jul 2017  ·  4Comments  ·  Source: ElemeFE/element

Element UI version

1.3.7

OS/Browsers version

win 10/ chrome 58.0.3029.110

Vue version

2.3.4

Reproduction Link

https://jsfiddle.net/co8c0sk4/

Steps to reproduce

Click on the change button twice will make the table appear broken.

If v-if changed to v-show, the columns will not be hidden, and clicking on the button will not do anything.

What is Expected?

Clicking on the change button will be able to show between Address and Name.

What is actually happening?

Clicking on the change button will break the table. It doesn't matter if I use v-show or v-if, it simply won't work.

Most helpful comment

You need to add key: https://jsfiddle.net/co8c0sk4/7/

All 4 comments

A similar problem happens if you try to dynamically change the width of some column.

I tried to control el-table itself using v-if and v-else-if. Still no use when changed. Looks like there's something dynamic going on behind the back that's preventing it from switching.

You need to add key: https://jsfiddle.net/co8c0sk4/7/

Doesn't work with v-show...my table is pretty big, i would like to avoid to rerender everything... :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fscardua picture fscardua  ·  3Comments

Zhao-github picture Zhao-github  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments

akaylh picture akaylh  ·  3Comments

chao-hua picture chao-hua  ·  3Comments