Skip to content

Instantly share code, notes, and snippets.

@eserdinyo
Last active September 24, 2018 07:24
Show Gist options
  • Save eserdinyo/0e27d9ef7777bfd799eace7fa9559348 to your computer and use it in GitHub Desktop.
Save eserdinyo/0e27d9ef7777bfd799eace7fa9559348 to your computer and use it in GitHub Desktop.
<script>
export default {
data() {
return {};
},
methods: {},
directives: {
"localRenk": {
bind(el, binding, vnode) {
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);
}
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment