Skip to content

Instantly share code, notes, and snippets.

@ayamflow
Forked from rayfranco/dom.js
Created August 4, 2014 14:58
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 ayamflow/c96c130ec979703d6286 to your computer and use it in GitHub Desktop.
Save ayamflow/c96c130ec979703d6286 to your computer and use it in GitHub Desktop.
Vue.directive('dom', {
isLiteral: true,
bind: function () {
this.vm.$.dom = this.vm.$.dom || {};
this.vm.$.dom[this.expression] = this.el;
},
unbind: function () {
delete this.vm.$.dom[this.expression];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment