element icon indicating copy to clipboard operation
element copied to clipboard

tab关闭时消除tab中的值会同时消除两个tab标签

Open lodamemory opened this issue 10 years ago • 6 comments

ElementUI version

1.0.3

OS/Browers version

chrome

Vue version

2.0.0

Reproduction Link

测试 代码 http://jsfiddle.net/ur9rsukg/2/

Steps to reproduce

What is Expected?

想要关闭标签时把标签中的值也消除

What is actually happening?

我remove-click事件触发时去消除this.tabs中的值,但是如果不是从最后一个开始关闭,从中间关闭一个时会顺带关闭后面的一个。

lodamemory avatar Nov 30 '16 14:11 lodamemory

在用法上不建议使用数组对tab-pane进行比遍历,目前会导致一些奇怪的问题

baiyaaaaa avatar Dec 01 '16 03:12 baiyaaaaa

@baiyaaaaa 那有什么解决方案么?

lodamemory avatar Dec 01 '16 06:12 lodamemory

@lodamemory 不要直接修改绑定的tab list

baiyaaaaa avatar Dec 01 '16 10:12 baiyaaaaa

这个功能还有很又意义的,建议支持

newlife avatar Dec 01 '16 11:12 newlife

@baiyaaaaa 这样我就没法控制tab的动态增加删除了啊?这样关了不好吧,可能不是bug,但是也可以做一个类似优化,我觉得一般固定tab肯定没动态tab用的多

lodamemory avatar Dec 02 '16 02:12 lodamemory

repeat的时候,如果使用删除钩子删除数组的一项,会删除两项,目前看是无解的

所以我的解决办法是在updated函数里面查找元素给每个tab header里面插入一个删除icon的dom

再去绑定事件,删除数组一项

有点累啊

frontoldman avatar Dec 26 '16 09:12 frontoldman