Created
February 12, 2018 13:43
-
-
Save eserdinyo/4f1c94d2a80c07af52c809206dc0ce67 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
<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