Created
January 30, 2018 21:34
-
-
Save matthieu-D/f3a261096fd6b86f19dc6059efa3de37 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 { Directive } from 'vue-ts-decorate'; | |
@Directive({ name: 'customIf', local: true }) | |
export default class CustomIf { | |
bind(el, binding, vnode) { | |
const display = vnode.data.attrs.display; | |
const delay = binding.arg; | |
if(display === false) { | |
setTimeout(() => vnode.elm.remove(), delay); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment