Created
May 25, 2017 14:19
-
-
Save vuejsdevelopers/373a7ca4abe7fff0f64e10bf81d8fa63 to your computer and use it in GitHub Desktop.
Using JSX with Vue.js - Snippet 07
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('This is the message.') | |
} | |
}, | |
render(h) { | |
return ( | |
<span class={{ 'my-class': true }} on-click={ this.hello } > | |
{ this.msg } | |
</span> | |
) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment