vue.js - 带有 vue2-animate 的 vue 过渡组不起作用
问题描述
我一直在努力使 vue 转换工作。
我正在使用 vue2-animate 和 vue 来为列表项出现/消失时创建一些简单的过渡效果。
这是块:
<transition-group class="mt-2"
name="fadeLeft"
v-if="type == selectedType"
tag="ul">
<li class="mb-2" v-bind:key="category.name"
v-for="(category, index) in getCategoriesForType(type)"
@click="selectCategory(category)">
{{ category.name }}
</li>
</transition-group>
当我尝试它时,它不会添加任何效果。它只是显示/隐藏列表。
我已经测试/确认动画在不同的组件中工作,但无法弄清楚为什么上面的代码不做任何动画。
这是正在工作的块:
<ul class="list-group notes" v-if="notes.length > 0">
<transition-group name="fadeLeft">
<li v-for="(note, index) in notes" v-bind:key="note" class="list-group-item" v-on:remove="notes.splice(index, 1)">
<button class="close" @click="removeNote(index)"><span class="fa fa-times"></span></button>
{{ note.text }}
</li>
</transition-group>
</ul>
解决方案
推荐阅读
- http - 将服务器发送事件与 HTTP2 一起使用时,是否仍有实际的 6 个连接限制?
- css - 如何修复 @each 指令的这个 SCSS 编译错误?
- css - Primefaces数据表上的stickyHeader在layoutUnit中显示重复的标题
- reactjs - 对象作为 React 子对象无效(找到:带键的对象 {
})。如果您打算渲染一组孩子,请改用数组 - android - Rxjava 和 OkHttp 请求
- twilio - Twilio TaskRouter.js 更新活动或保留导致错误 403(定义的策略使我们无法访问给定资源)
- r - .Call("dplyr_rbind_list__impl", PACKAGE = "dplyr", dots) 中的错误
- apache - 未定义符号 apr_atomic_add64
- java - 如何使用骆驼路由数据?
- javascript - 从特定类的所有选定选项创建数组