Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

vue.js - Add class to only one list element in list during animation in Vue, Transition

I have a drag n drop editor written in Vue, I drags items into a section and now there are more than one item in the section, now each item has option to either move it up(above the item above it) or move it down (below the item under it) and each of these items are elements of list and the items are moved with animation using list-transition in Vue. Now the problem is that when I tries to move item A up, item A moves rightly upwards and the item B which was above item A moves downward, So here in each transition two elements are moved and the V-move class is applied to both items A and B involved in the movement, What I wants to do is to apply a class to only that item which I clicked on (item A in this case), and the class should apply on item A only during the transition just like the V-move class does and after the items have changed their positions the class should be removed automatically.

question from:https://stackoverflow.com/questions/65924799/add-class-to-only-one-list-element-in-list-during-animation-in-vue-transition

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...