【发布时间】:2018-09-14 22:30:05
【问题描述】:
我正在使用 VueJS,我打算在表格内的列表中生成动画,我希望在添加(执行推送)或消除(拼接)时在表格内生成动画。
尝试转换组,但我没有得到我想要的。
我的代码如下,我使用的是VueJS、Bootstrap 4和Animatecss
<template>
<thead class=" wow fadeIn animated">
<tr>
<th class="w-30">Name</th>
<th class="w-10"></th>
</tr>
</thead>
<transition-group name="bounceInUp" tag="tbody" class="wow animated" >
<tr v-for="(product,index) in products" :key="index"
>
<td class="w-30">{{ product.name }}</td>
<td class="w-10">
<a class="btn-floating btn-sm btn-danger"
@click="deleteItem(index)">
<i class="fa fa-trash"></i>
</a>
</td>
</tr>
</transition-group>
</template>
<script>
export default{
methods :{
addItem(){
this.products.push = {name:'Hello World'}
}
deleteItem(index){
this.products.splice(index, 1);
}
}
}
</script>
【问题讨论】:
-
你想要哪个动画?
-
animatecss 类的bounceInUp
标签: javascript css vue.js vuejs2 animate.css