Last active
September 24, 2018 07:18
-
-
Save eserdinyo/a43e3b96e253699f9007e807166ae7d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import App from './App.vue' | |
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