Skip to content

Instantly share code, notes, and snippets.

@rayfranco
Created August 4, 2014 14:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rayfranco/277b95317c32f3a6771b to your computer and use it in GitHub Desktop.
Save rayfranco/277b95317c32f3a6771b 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