vue同一页面动态路由切换animate.css动画不重新加载的问题

1、需要在updated生命周期里再重新创建wow示例

updated() {
          new this.$wow.WOW().init({//新建实列
                boxClass: 'wow',//class名字
                animateClass: 'animate__animated',//animateclass动画库类名,和当前animate动画库决定
                offset: 0,//到元素距离触发动画(当默认为0)
                mobile: true,//在移动设备上触发动画(默认为true)
                live: true//对异步加载的内容进行操作(默认为true)
                })
        },

2、公用的每个标签上加上动态的key值,使得虚拟dom重新加载真实dom

猜你喜欢

转载自blog.csdn.net/hyupeng1006/article/details/127373241