首页 > 其他分享 >vue3中使用animate.css+wow.js

vue3中使用animate.css+wow.js

时间:2024-01-24 18:56:15浏览次数:30  
标签:default wow js vue3 animate true css

官网链接:

animate

wow.js
版本声明:

  "dependencies": {
    "vue": "^3.3.11",
    "animate.css": "^4.1.1",
    "wow.js": "^1.2.2"
  },

1. 安装:

npm install animate.css --save
npm install wow.js

2. 注册:

- 无效注册方式!!!

// main.js

import animated from "animate.css"; app.use(animated);

- 正确的注册方式!!!

// main.js 
import "animate.css"; import 'animate.css/animate.compat.css';

3. 使用:

a:animate直接使用

b:wowjs需要在使用的页面引入

// 业务页面
<script>
import WOW from "wow.js";
//  生命周期
onMounted(() => {
    console.log('mounted')
    const wow = new WOW({
        boxClass: "wow", // animated element css class (default is wow)
        animateClass: "animated", // animation css class (default is animated)
        offset: 0, // distance to the element when triggering the animation (default is 0)
        mobile: true, // trigger animations on mobile devices (default is true)
        live: true, // act on asynchronously loaded content (default is true)
        callback: function (box) {
            // the callback is fired every time an animation is started
            // the argument that is passed in is the DOM node being animated
            console.log('the argument >>')
        },
        scrollContainer: null, // optional scroll container selector, otherwise use window,
        resetAnimation: true, // reset animation on end (default is true)
    });
    wow.init();
})
</script>

<template>
     <div
           class="container-fluid py-5 wow fadeInUp"
           data-wow-delay="0.1s"
      >
        xxxxx
     </div>
</template>

  

标签:default,wow,js,vue3,animate,true,css
From: https://www.cnblogs.com/CZheng7/p/17985515

相关文章

  • sortable.js el-table 树形表 拖拽
    实现的功能:该树形表只有一级子节点该子节点只能在当前父节点中拖拽,不能跨父节点拖拽同时只能展开一个父节点,其他父节点闭合实现的关键点:mounted挂载初始化sortable拖拽完onEnd方法返回的index是整个列表的排序,要扁平化数组调用该方法getTable()后台多返回一个kid,......
  • 用 UNPKG/CDNJS 国内镜像优化网页加载速度
    unpkg.com和cdnjs.cloudflare.com这两个官方域名的加载速度实在令人汗颜。抽了一下午找了些国内能用的高速稳定镜像,批量更换一下就能加速访问了。unpkg用Zstatic的镜像,把原来的unpkg.com换成s4.zstatic.net/npmcdnjs用360或者Zstatic的镜像,把原来的cdnjs.cloudfl......
  • JS中的扩展运算符(...)和剩余运算符(...)
    一、概念在JS中,扩展运算符(spread)是三个点 (...) ,剩余运算符(rest)也是三个点 (...)二、扩展运算符(1)基本使用:扩展运算符的主要作用是将一个数组转为用逗号分隔的参数序列,它好比rest的逆运算//传递数据代替多个字符串的形式functiontest(a,b,c){console.log(a);//1......
  • JS复制JPG图片到剪切板
    HTML代码:<buttonid="button"type="primary"class="ui-button">复制JPG图片</button><imgid="image"width="150"src="./mybook.jpg">JS代码:constdoCopyImg2Clipboard=async(image,suc......
  • PgSql 行转列的使用 jsonb_each与row_to_json
    PgSql行转列的使用jsonb_each与row_to_json1:正常的几行数据2:转换后3:code(以commodity来分组)select"Id","JabilPn","Brand","PricelnUsd","Commodity"from"Eme_Materials"emwhere"Id"<=3s......
  • idea中启动web、jsp项目
    1.idea打开项目选择要打开的项目的根目录2.项目配置配置jdkmodules配置添加web添加依赖删除爆红的依赖添加依赖目录或者jar配置web.xml配置lib如果没有生成则添加项目所需依赖facets配置和web配置一样配置artifacts3.配置tomcat......
  • js/ts中Date类的ref响应式 -- VUE3
    现象:Date对象无法响应式原因:Date是个深层对象,外面那层可以响应,但是更改里面的层,则不会被侦测到改动解决:强制触发副作用即可参考文档:https://cn.vuejs.org/api/reactivity-advanced.html#triggerref<template><divclass="cnblogs_yucloud">{{DateTime}}</div>......
  • js 旧 IE 中的 innerHTML
    在所有现代浏览器中,通过innerHTML插入的<script>标签是不会执行的。而在IE8及之前的版本中,只要这样插入的<script>元素指定了defer属性,且<script>之前是“受控元素”(scopedelement),那就是可以执行的。<script>元素与<style>或注释一样,都是“非受控元素”(NoScopeelement)......
  • js 自定义数据属性
    HTML5允许给元素指定非标准的属性,但要使用前缀data-以便告诉浏览器,这些属性既不包含与渲染有关的信息,也不包含元素的语义信息。除了前缀,自定义属性对命名是没有限制的,data-后面跟什么都可以。下面是一个例子:<divid="myDiv"data-appId="12345"data-myname="Nicholas"></div>......
  • js 焦点管理
    HTML5增加了辅助DOM焦点管理的功能。首先是document.activeElement,始终包含当前拥有焦点的DOM元素。页面加载时,可以通过用户输入(按Tab键或代码中使用focus()方法)让某个元素自动获得焦点。例如:letbutton=document.getElementById("myButton");button.focus();......