Wowjs 和 Animate.css 不适用于 VUEJS

问题描述

我正在尝试使用 wowjs 或 animate.css 包含一些动画,但它似乎不起作用。 这是我采取的步骤。

一个

npm install wowjs

在 main.js 中

import 'animate.css';

在我想使用动画的页面

<b-container id = "container">
    <b-row style = "margin-top: 100px;" class = "animated fadeInUp">
    ....
    </b-row>
<b-container>

在我想使用 wowjs 的页面

<template>
    <b-container id = "container">
        <b-row style = "margin-top: 100px;" class = "wow fadeInUp">
            ....
        </b-row>
    <b-container>
<template>

<script>
    import {WOW} from 'wowjs';
    export default {
        mounted() {
            new WOW().init();
        },}
</script>

在这里做错了什么吗?根本没有动画显示。 感谢您的帮助!

解决方法

对于 vue,你需要有最新的 vue-cli (4.5.12) 和 animate.css (4.1.1) 版本才能工作。

可能您想直接导入它们并通过 CDN 加载它们。

对于 wowjs 尝试,(npm install wow.js) 代替。您可以在此处查看参考资料:

https://github.com/animate-css/animate.css/issues/993

https://github.com/matthieua/WOW/issues/252