Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created January 30, 2018 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/f3a261096fd6b86f19dc6059efa3de37 to your computer and use it in GitHub Desktop.
Save matthieu-D/f3a261096fd6b86f19dc6059efa3de37 to your computer and use it in GitHub Desktop.
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