From 8c877e3d8965fc2a2b0506c9bee515878c03d013 Mon Sep 17 00:00:00 2001 From: Catalin Zalog Date: Sat, 6 Jul 2019 21:30:24 +0300 Subject: [PATCH] feat: adds boolean value For those situations when we need to disable `v-ripple="(true ? true : false)"` --- src/ripple.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ripple.js b/src/ripple.js index 55179c0..262b620 100644 --- a/src/ripple.js +++ b/src/ripple.js @@ -1,5 +1,6 @@ var Ripple = { bind: function(el, binding){ + if (binding.value === false) return; // Default values. var props = { @@ -13,7 +14,7 @@ var Ripple = { rippler(event, el, binding.value); }); - var bg = binding.value || Ripple.color || 'rgba(0, 0, 0, 0.35)'; + var bg = typeof binding.value === 'string' && binding.value || Ripple.color || 'rgba(0, 0, 0, 0.35)'; var zIndex = Ripple.zIndex || '9999'; function rippler(event, el) { @@ -146,4 +147,4 @@ function setProps(modifiers,props) { }); } -export default Ripple; \ No newline at end of file +export default Ripple;