Skip to content

Instantly share code, notes, and snippets.

@eserdinyo
Created February 12, 2018 13:18
Show Gist options
  • Save eserdinyo/828c09323559716d390f7a1e8fce037f to your computer and use it in GitHub Desktop.
Save eserdinyo/828c09323559716d390f7a1e8fce037f to your computer and use it in GitHub Desktop.
Vue.directive('renk', {
bind(el, binding) {
let delay = 0;
if (binding.modifiers['delayed']) {
delay = 3000;
}
setTimeout(() => {
if (binding.arg === 'background') {
el.style.backgroundColor = binding.value;
} else {
el.style.color = binding.value;
}
}, delay)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment