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

wordpress 下载站友情链接免费发布平台

wordpress 下载站,友情链接免费发布平台,APP网站建设什么用处,做环卫设备都有哪些网站Vue - 关于v-wave 波浪动画组件 这个动画库可以在标签中添加新的v-wave属性,来让点击标签元素后添加漂亮的波纹效果,并且可以根据父元素自动形成波纹的颜色,也可以自定义波纹颜色,持续时间,透明度,触发的对…

Vue - 关于v-wave 波浪动画组件

这个动画库可以在标签中添加新的v-wave属性,来让点击标签元素后添加漂亮的波纹效果,并且可以根据父元素自动形成波纹的颜色,也可以自定义波纹颜色,持续时间,透明度,触发的对象等。

一、安装v-wave

npm i v-wave

Vue2引入:

import Vue from 'vue'
import VWave from 'v-wave'Vue.use(VWave)

Vue3引入:

import {createApp} from 'vue'
import VWave from 'v-wave'
import App from './App.vue'createApp(App).use(VWave).mount('#app')

通过CDN

<script src="https://unpkg.com/v-wave"></script>
# With a CDN, `VWave` is made available as a global
Vue.use(VWave)

二、如何使用

要使用该动画组件,只需将v-wave属性添加到需要波纹效果的元素标签中,也可以对象的形式去自定义波纹的效果。

默认演示效果如下:

<template><div class="box" v-wave>Click here</div>
</template><style scoped>
.box {display: grid;place-items: center;width: 200px;height: 200px;padding: 16px;box-shadow: 0px 0px 5px 1px #00000026;cursor: pointer;
}
</style>

在这里插入图片描述

自定义演示效果如下:

<template><divclass="box"v-wave="{color: 'blue',initialOpacity: 0.5,duration: 2,easing: 'ease-in',}">Click here</div>
</template><style scoped>
.box {display: grid;place-items: center;width: 200px;height: 200px;padding: 16px;box-shadow: 0px 0px 5px 1px #00000026;cursor: pointer;
}
</style>

在这里插入图片描述

使用触发器示例(父子元素):

使用v-wave-trigger绑定在需要点击的子元素标签上,可触发父元素v-wave的动画效果。

<template><label v-wave class="text-input"><input type="text" placeholder="Search" /><imgv-wave-triggersrc="https://justintaddei.github.io/v-wave/imgs/search.svg"/></label>
</template><style scoped>
.text-input {display: grid;grid-template: 1fr / 1fr auto;place-items: center;padding: 0 16px;height: 48px;border: 2px solid #aaa;border-radius: 8px;font-size: 20px;
}
.text-input> input {border: none;outline: none;background: transparent;font-size: inherit;}
</style>

在这里插入图片描述

使用触发器示例(根据ID触发,支持多对多):

设置v-wave-trigger:gridDemov-wave=“{trigger: ‘gridDemo’}”,可支持多对多关系,点击其中一个元素,相同trigger的元素也会同步触发。

<template><div  class="waveGrid"><div class="box small" v-wave-trigger:gridDemo v-wave="{trigger: 'gridDemo',color:'blue',duration:1}" style=""></div>......<div class="box small" v-wave-trigger:gridDemo v-wave="{trigger: 'gridDemo',color:'blue',duration:1}" style=""></div></div>
</template><style scoped>
.waveGrid {display: inline-grid;grid-template: repeat(5, auto) / repeat(5, auto);place-items: center;gap: 32px;
}
.waveGrid .box.small {width: 50px;height: 50px;cursor: pointer;
}
.box {display: grid;place-items: center;width: 200px;height: 200px;padding: 16px;box-shadow: 0 4px 24px #00000026;cursor: pointer;
}
</style>

在这里插入图片描述
也可单击其中一个按钮将激活另一个按钮上的波浪:

<button v-wave="{trigger: 'button2'}" v-wave-trigger:button1>Button 1</button><button v-wave="{trigger: 'button1'}" v-wave-trigger:button2>Button 2</button>

三、组件参数Props

名称默认值类型描述
color“currentColor”string颜色
initialOpacity0.2number涟漪首次出现时的不透明度
finalOpacity0.1number当涟漪停止移动时,涟漪应该具有的不透明度
duration0.4number涟漪的总持续时间,以秒为单位
dissolveDuration0.15number“溶解动画”的持续时间,以秒为单位
waitForReleasetrueboolean鼠标释放点击之前,波纹不会溶解
easingease-outstring过度定时函数,具体查看
cancellationPeriod75number延迟,以毫秒为单位
trigger“auto”string 、boolean 、“auto”设置与触发器一起使用时波纹的行为
disabledfalseboolean无论 respectDisabledAttribute 如何,都禁用元素上的波形效果
respectDisabledAttributetrueboolean如果元素上存在 html 属性,则波形效果将被禁用
respectPrefersReducedMotiontrueboolean如果用户的 prefers-reduced-motion 设置为true ,则波形效果将被禁用
stopPropagationfalseboolean防止事件传播到父元素
tagName“div”string设置用作波形容器的元素的标记名称。这在默认值可能会干扰或类似的选择器的情况下非常有用

v-wave动画组件能提供比较漂亮的点击波纹动画效果,且组件自定义比较高,可支持多对多触发关系,有兴趣的可以尝试下!

官网链接: v-wave官网
github地址: v-wave - github

http://www.dinnco.com/news/77424.html

相关文章:

  • 闽清建设局网站seo博客优化
  • 编辑器wordpressseo编辑是干什么的
  • 建一个网站需要什么资料搜索软件排行榜前十名
  • 时间轴wordpress关键词seo是什么意思
  • python 网站架构济宁百度竞价推广
  • 微网站建设难不难温州seo团队
  • 网站建设的实施方案郑州seo实战培训
  • 电商创业怎么做百家港 seo服务
  • 汉沽网站建设高端网站制作
  • 建设通网站总打骚扰电话国外b站推广网站
  • 西安网站建设制作价格全网营销软件
  • 如何编写一个网站太原关键词排名提升
  • 网站防护找谁做网络营销策划书模板
  • 网站排名易下拉用法营销型网站案例
  • 做网站是否过时了什么是seo优化
  • 新闻发布会新闻通稿百度seo排名查询
  • 汽车网站建设公司教育培训机构十大排名
  • 图片展示类网站免费建站系统哪个好用吗
  • 网站根据城市做二级目录整合营销方案案例
  • 社交网站推广怎么做市场调研报告模板范文
  • it运维职业规划江北seo综合优化外包
  • 网站规划与开发技术网站增加外链的方法有哪些
  • 网站定制公司哪家最权威十大舆情网站
  • 用phpmysql做图书网站常见的网络营销模式
  • 网站百度收录秒收方法智能网站排名优化
  • 企业网站应该怎么做免费网站建设哪个好
  • 维纳斯式束腰Wordpress福州seo技术培训
  • 做网站怎么赚钱滑县电网站优化方案案例
  • 八旬老太做直播 什么网站亚马逊排名seo
  • 西安网站空间百度网站下载