当前位置: 首页 > news >正文

nuxt3添加wowjs动效

1、安装wowjs

pnpm i wowjs@1.1.3

2、node_modules复制wowjs代码

路径/node_modules/wowjs/dist/wow.js。不知道路径则查看node_modules/wowjs/package.json里面的main选项

2.1、在public文件夹创建wowjs.js文件

/public/wowjs.js

export default (callthis) => { // !!// 这是我们复制的wowjs自动调用函数,我们更改里面绑定的this(function() {// ...xxx}).call(callthis); // !!  这里传入上面的参数callthis
}

3、plugins创建插件文件wowjs.client.ts

路径/plugins/wowjs.client.ts。注意后缀名.client.ts不可更改

import wowjs from "public/wowjs.js"export default defineNuxtPlugin(() => {// 先绑定window,注意调用顺序不能错wowjs(window)// 再调用WOWnew WOW({animateClass: "animated",offset: 0,live: true,}).init();
})

4、配置nuxt.config.ts

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({// ...// 引入全局csscss: ['wowjs/css/libs/animate.css'],
});

5、测试

<div class=" wow fadeInUp" data-wow-duration="2s"></div>
http://www.lryc.cn/news/486045.html

相关文章:

  • 我们是如何实现 TiDB Cloud Serverless 的 - 成本篇
  • PCL算法汇总
  • sql注入之二次注入(sqlilabs-less24)
  • Android compose 软键盘 遮挡对话框中TextField 输入框
  • spring-data-elasticsearch 3.2.4 实现桶bucket排序去重,实现指定字段的聚合搜索
  • 【项目开发】分析六种常用软件架构
  • 算法和程序的区别
  • 用指针遍历数组
  • 《Probing the 3D Awareness of Visual Foundation Models》论文解析——多视图一致性
  • 使用pip安装esp32的擦除、写入固件的esptool库
  • 传奇996_23——杀怪掉落,自动捡取,捡取动画
  • 【030】基于51单片机甲醛检测报警器【Proteus仿真+Keil程序+报告+原理图】
  • 微信小程序:vant组件库安装步骤
  • 处理namespace问题:Namespace not specified for AGP 8.0.0
  • C++(Qt)软件调试---内存分析工具Heob(26)
  • Redis五大基本类型——String字符串命令详解(命令用法详解+思维导图详解)
  • Flutter中的Material Theme完全指南:从入门到实战
  • Python 第三方库 PyQt5 的安装
  • CSS基础也要进行模电实验
  • 贴代码框架PasteForm特性介绍之markdown和richtext
  • 3D Gaussian Splatting 代码层理解之Part3
  • Ceph 中PG与PGP的概述
  • 已解决:spark代码中sqlContext.createDataframe空指针异常
  • flutter字体大小切换案例 小字体,标准字体,大字体,超大字体案例
  • 智慧建造-运用Trimble技术将梦幻水族馆变为现实【上海沪敖3D】
  • 【NOIP提高组】计算系数
  • IDEA部署AI代写插件
  • 【阅读记录-章节1】Build a Large Language Model (From Scratch)
  • 微服务day08
  • JAVA接入WebScoket行情接口