element icon indicating copy to clipboard operation
element copied to clipboard

[Bug Report] change label el-tabs__ active-bar width calculation is incorrect

Open sundongzi opened this issue 5 years ago • 10 comments

Element UI version

2.13.1

OS/Browsers version

Chrome 83.0.4103.61(正式版本)

Vue version

2.6.10

Reproduction Link

https://codepen.io/sundongzi/pen/QWyjjQe

Steps to reproduce

When el-tab-pane is no content in it, dynamically change the length of the label content

What is Expected?

When the length of label content changes, el-tabs__active-bar width not change

What is actually happening?

When the length of label content changes, el-tabs__active-bar width should also change

sundongzi avatar Jun 08 '20 10:06 sundongzi

Translation of this issue:

Element UI version

2.13.0

OS/Browsers version

Chrome 83.0.4103.61 (official)

Vue version

2.6.10

Reproduction Link

https://codepen.io/sundongzi/pen/QWyjjQe

Steps to reproduce

When el-tab-pane is no content in it, dynamically change the length of the label content

What is Expected?

When the length of label content changes, el-tabs__ active-bar width not change

What is actually happening?

When the length of label content changes, el-tabs__ active-bar width should also change

element-bot avatar Jun 08 '20 10:06 element-bot

you could do like this,use key to update your component

Littledevil7 avatar Jun 10 '20 01:06 Littledevil7

https://codepen.io/littledevil7/pen/QWyyERe

Littledevil7 avatar Jun 10 '20 01:06 Littledevil7

@Littledevil7 Thank you for your advice,I just don't understand why components don't update,my current solution is as follows

sundongzi avatar Jun 10 '20 02:06 sundongzi

https://codepen.io/sundongzi/pen/xxZZEMJ

sundongzi avatar Jun 10 '20 02:06 sundongzi

This could be a style problem, which would not happen if type="card" or type="border-card" was used

Littledevil7 avatar Jun 13 '20 03:06 Littledevil7

I also have this problem, solved according to the opinion of the building Lord, want to know is what reason cause, please give instruction!

skysam1992 avatar Jul 28 '20 08:07 skysam1992

I also have this problem, solved according to the opinion of the building Lord, want to know is what reason cause, please give instruction!

use the method calcPaneInstances => https://github.com/ElemeFE/element/issues/19357#issuecomment-626042141

example => https://codepen.io/fuzi1996/pen/PoKjjKY

fuzi1996 avatar Oct 28 '21 02:10 fuzi1996

also have this problem

flyha avatar Aug 29 '22 06:08 flyha