Skip to content

Instantly share code, notes, and snippets.

@sparrow
Created March 6, 2018 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sparrow/9c821629a82967ec64423c9822839210 to your computer and use it in GitHub Desktop.
Save sparrow/9c821629a82967ec64423c9822839210 to your computer and use it in GitHub Desktop.
This is a JavaScript code snippet that we used for our blog post https://rubygarage.org/blog/things-vue-takes-from-react-and-angular at RubyGarage. This is an example of rendering functions & JSX support implementation in Vue.
import Vue from 'vue'
new Vue({
el: '#demo',
methods: {
sayHi () {
alert('Hi.')
}
},
render (h) => {
return (
<span on-click={this.sayHi}>Say hi!</span>
)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment