Closed
Description
Note the h function, which is a shorthand for a Vue instance's $createElement method, must be in the scope where the JSX is. Since this method is passed to component render functions as the first argument, in most cases you'd do this:
Vue.component('jsx-example', {
render (h) { // <-- h must be in scope
return <div id="foo">bar</div>
}
})
I just want to know why it is called h
and how to remember it :)
Activity
yyx990803 commentedon Jul 15, 2016
It comes from the term "hyperscript", which is commonly used in many virtual-dom implementations. "Hyperscript" itself stands for "script that generates HTML structures" because HTML is the acronym for "hyper-text markup language".
render: h => h(App)
please vuejs-templates/webpack-simple#29render: h => h(App)
具体含义解释 ly525/blog#90