vue 水波纹指令

物质纹波效应 (Material Ripple Effect)

Material Ripple Effect as Vue Directive.

材质纹波效果作为Vue指令。

View demo 查看演示 Download Source 下载源

This directive it's meant to be used in any element in which you like to achieve such ripple effect.

该指令可用于您希望实现这种涟漪效果的任何元素。

安装 (Installation)

npm install vue-ripple-directive --save

重要通知 (Important Notice)

The directive will work better if the element where you attach it is relative positioned. Although the directive will try to set position: relative if the element does not have this property. This is because since v2.0.* the ripple directive changed its positioning method to avoid trailing issues when elements in the UI move, causing the ripple to stay in previous position and not in the one that element moved to.

如果附加指令的位置相对 ,则该指令将更好地工作。 尽管该指令将尝试设置position: relative如果元素不具有此属性。 这是因为自v2.0。*起,涟漪指令更改了其定位方法,以避免在UI元素移动时出现拖尾问题,从而导致涟漪保持在先前位置,而不是元素移动到的位置。

选件 (Options)

Optional parameter to pass to the directive.

传递给指令的可选参数。

Parameter Type Values
color-value String Default: 'rgba(0, 0, 0, 0.35)'.
Accepts either HEX, RGB & RGBA values. For optimal look use RGBA with low opacity.
参数 类型 价值观
color-value 默认值:'rgba(0,0,0,0.35)'
接受HEX,RGB和RGBA值。 为了获得最佳外观,请使用不透明度较低的RGBA。

修饰符 (Modifiers)

By default this directive attaches a click handler to the element as well as the transition is set for 600ms. For those who wants to modify the same, just pass modifiers to the directive:

默认情况下,此指令将点击处理程序附加到元素,并且过渡设置为600ms。 对于那些想要修改它们的人,只需将修饰符传递给指令:

v-ripple.mouseover.500

Can also modify only one

也只能修改一个

v-ripple.mouseover

样品和用法 (Sample & Usage)

First you need to import the directive and add it to Vue.

首先,您需要导入指令并将其添加到Vue。

import Ripple from 'vue-ripple-directive'Vue.directive('ripple', Ripple);

Then use on any element you want to achieve the effect.

然后在要获得效果的任何元素上使用。

<div v-ripple class="button is-primary">This is a button</div>

If you want a custom color just pass a color parameter as string. It's best if you use RGBA colors to achieve a greater effect.

如果要自定义颜色,只需将color参数作为string传递即可。 最好使用RGBA颜色以获得更好的效果。

<div v-ripple="'rgba(255, 255, 255, 0.35)'"  class="button">I have different color</div>

全局设置 (Global settings)

You can set the default color and z-index for all your ripples as the following example

您可以为所有波纹设置默认颜色和z-index,如以下示例所示

import Ripple from 'vue-ripple-directive'Ripple.color = 'rgba(255, 255, 255, 0.35)';
Ripple.zIndex = 55;
Vue.directive('ripple', Ripple);

翻译自: https://vuejsexamples.com/material-ripple-effect-as-vue-directive/

vue 水波纹指令

vue 水波纹指令_纹波效应作为Vue指令相关推荐

  1. canvas水波纹效果_如何使用HTML5 canvas创建水波纹效果

    canvas水波纹效果 Water ripple effect with HTML5. Today we continue JavaScript examples, and our article w ...

  2. vue实现波纹效果_简单的Vue.js插件可实现自定义波纹效果

    vue实现波纹效果 Vue-Rippler (vue-rippler) Simple Vue.js plugin for custom ripple effect. 简单的Vue.js插件可实现自定义 ...

  3. vue data数据修改_史上最强vue总结,万字长文

    vue框架篇 vue的优点 轻量级框架:只关注视图层,是一个构建数据的视图集合,大小只有几十kb: 简单易学:国人开发,中文文档,不存在语言障碍 ,易于理解和学习: 双向数据绑定:保留了angular ...

  4. vue和react相同点_我在React和Vue中创建了相同的应用程序。 这是区别。

    vue和react相同点 by Sunil Sandhu 由Sunil Sandhu 我在React和Vue中创建了相同的应用程序. 这是区别. (I created the same app in ...

  5. cmd指令大全指令_干货 | Linux 超全实用指令大全

    运行级别和找回root密码 指定运行级别 运行级别说明: 0:关机 1:单用户[找回丢失密码] 2:多用户状态没有网络服务 3:多用户状态有网络服务 4:系统未使用保留给用户 5:图形界面 6:系统重 ...

  6. vue 箭头函数兼容性_前端学习计划之VUE学习(二)

    创建一个实例 每个Vue应用都是通过Vue函数创建一个新的Vue实例开始的: 数据与方法 当Vue实例按照上述方式被创建时,Vue的响应式系统中就加入了data对象,在使用中可以直接通过属性的调用方式 ...

  7. vue 启动时卡死_十分钟浅入Vue 原理

    vue原理 引用 众所周知vue是一个MVVM 渐进式框架,MVVM是vue的设计模式,在vue框架中数据会自动驱动视图. 1.MVVM设计模式 ​ 解释 View是视图,就是DOM:对应视图也就是H ...

  8. ant design vue table 高度自适应_很受欢迎的vue前端UI框架

    最近在逛各大网站,论坛,SegmentFault等编程问答社区,发现Vue.js异常火爆,重复性的提问和内容也很多,小编自己也趁着这个大前端的热潮,着手学习了一段时间的Vue.js,目前用它正在做自己 ...

  9. python我的世界给予物品指令_我的世界给予物品指令大全 | 手游网游页游攻略大全...

    发布时间:2015-11-19 我的世界命令方块指令大全 我的世界命令方块怎么用.我的世界命令方块都有哪些攻能?我的世界命令方块怎么使用?下面99单机网小编给大家带来我的世界命令方块指令大全. /gi ...

最新文章

  1. 逻辑模型三要素-完整性约束
  2. javax.swing.jFrame
  3. QEMU — Guest Agent
  4. Python+Django+Eclipse 在Windows下快速开发自己的网站
  5. [BUUCTF-pwn]——jarvisoj_level4
  6. Hadoop--Linux环境下JDK/Hadoop的安装与配置
  7. 电脑DNS优选网络加速工具 可以提高网速
  8. 百度风云榜前50名小偷——专门用于提高你网站的流量!
  9. ASP.NET 中的 SQL Server 应用服务数据库角色和视图
  10. 24.Creating Customer Groups
  11. sql的执行顺序(from平凡世界)
  12. 蓝桥杯省赛JavaB组真题
  13. 2021年广东省安全员A证第三批(主要负责人)考试内容及广东省安全员A证第三批(主要负责人)新版试题
  14. DO447安装红帽Ansible Tower
  15. 第四讲 移动互联网接入技术
  16. 特别推荐BLOG(一) 程序猿DD的博客
  17. 帝国cms内容页模版
  18. Wincc报表案例_设备运行报表
  19. 黑暗城堡(最短路径树)
  20. android 字体倒影,Android实现图片的倒影效果

热门文章

  1. python:爬取58同城全部二手商品信息(转转网)
  2. 这6个自学网站在知乎得到40万的热推!凭什么?看了就知道!
  3. Linux九阴真经之九阴白骨爪残卷16
  4. modbus协议中的线圈、寄存器等的解释
  5. JS接口请求的写法(原生post与get请求、http请求等)
  6. 计算机软考有哪些科目??
  7. 华为OPENCPU如何自动获取网络时间
  8. 如何使用Gitte获取和上传代码
  9. 网络安全小白使用burp suit抓包过程
  10. mysql数据库中修改错别字_如何形成正确的MySQL连接字符串?[关闭]