Skip to content

Instantly share code, notes, and snippets.

@eserdinyo
Created February 12, 2018 13:43
Show Gist options
  • Save eserdinyo/4f1c94d2a80c07af52c809206dc0ce67 to your computer and use it in GitHub Desktop.
Save eserdinyo/4f1c94d2a80c07af52c809206dc0ce67 to your computer and use it in GitHub Desktop.
<script>
export default {
data() {
return {
counter: 0,
};
},
methods: {
clicked() {
this.counter ++;
},
},
directives: {
myOn: {
bind(el, binding) {
const event = binding.arg;
const fn = binding.value;
el.addEventListener(event, fn);
}
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment