我想根据用户的动作动态地改变动画的类型。因此,例如,当单击第一个按钮并将离开动画命名为"hello“元素时,应该使用bounceOutRight动画。但是,如果用户单击第二个按钮,"hello“元素应该使用bounceOutLeft动画。这个例子来自vue.js 文档,我正在尝试对它进行扩展。与vue示例一样,它使用animate.css库。
我尝试使用v-bind:leave class=“动画bounceOutRight”,但这会将错误抛出无效表达式。
<button @click="show = !show">
Toggle Bounce Right
</button>
<button @click="show = !show">
Toggle Bounce Left
</button>
<transition
name="custom-classes-transition"
enter-active-class="animated tada"
leave-active-class="animated bounceOutRight"
>
<p v-if="show">hello</p>
</transition>发布于 2016-12-18 16:19:04
https://stackoverflow.com/questions/41210314
复制相似问题