如何使用自定义标记和类的`transition-group`

时间:2016-11-10 12:45:29

标签: vue.js

我需要使用[[0,1,0,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0], [0,0,0,0,1,0,0,0,0]]

渲染div
item

<div class="ui horizontal list"> <transition-group name="custom-classes-transition” enter-active-class="animated fadeInLeft" leave-active-class="animated fadeOutLeft"> <div class="item" v-for="(filter, filterIndex) in filters" :key="filterIndex”> .. </div> </transition-group> </div> 应直接嵌套.item

我尝试添加.ui.list,但这会在我的tag="div”

中添加一个新的div

1 个答案:

答案 0 :(得分:9)

只需在class添加transition-group道具。

示例:

<transition-group class="ui horizontal list" name="custom-classes-transition" enter-active-class="animated fadeInLeft" leave-active-class="animated fadeOutLeft">
    <div class="item" v-for="(filter, filterIndex) in filters" :key="filterIndex"> .. </div>
</transition-group>