Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二次赋值后的拖拽问题 #10

Open
luguosheng1314 opened this issue Jun 15, 2017 · 5 comments
Open

二次赋值后的拖拽问题 #10

luguosheng1314 opened this issue Jun 15, 2017 · 5 comments

Comments

@luguosheng1314
Copy link

第一次帮定数据 arr = [obj1,obj2] 然后通过js修改成 arr=[obj3,obj4] 然后拖拽就失效了,调试发现第二次拖拽的时候 arr变成了 arr : [obj3,obj4,undefined]

@Zeus-Iqd
Copy link

大佬我也遇到这个问题了,不能进行重新赋值,请问你解决了吗?@luguosheng1314

@Zeus-Iqd
Copy link

@luguosheng1314

@luguosheng1314
Copy link
Author

解决了

@luguosheng1314
Copy link
Author

我这个问题是出现在对一个排序列表进行动态添加数据后,排序功能会出问题,所以我用了v-if 来控制列表的重新渲染,每次添加新数据进来后,先把渲染列表的数组清空,然后重新赋值。这样就不会有问题了。

@nicegonice
Copy link

@luguosheng1314 的思路确实可以,可以用v-if控制数据改变后v-for重新渲染,就可以多次拖拽了。谢谢🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants