Created
May 25, 2017 14:18
-
-
Save vuejsdevelopers/ea60f843b04e8474f033432b8e60a7a7 to your computer and use it in GitHub Desktop.
Using JSX with Vue.js - Snippet 05
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
new Vue({ | |
el: '#app', | |
data: { | |
msg: 'Show the message' | |
}, | |
methods: { | |
hello () { | |
alert('Here is the message') | |
} | |
}, | |
render (createElement) { | |
return createElement( | |
'span', | |
{ | |
class: { 'my-class': true }, | |
on: { | |
click: this.hello | |
} | |
}, | |
[ this.msg ] | |
); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment