render: h => h(App)
Is an acronym for the following content:
-
render: function (createElement) {
-
return createElement(App);
-
}
Further abbreviated as (ES6 grammar):
-
render (createElement) {
-
return createElement(App);
-
}
Further abbreviated as:
-
render ( h){
-
return h(App);
-
}
According to the wording of the arrow ES6 function, we get:
render: h => h(App);
Even You Vue.js according to which the author's reply , h the following meanings:
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".It comes from the word
hyperscript
, the word is often used in the realization of virtual-dom.Hyperscript
It refers to itself生成HTML 结构的 script 脚本
, because HTML ishyper-text markup language
the acronym (HTML)
Personal understanding: createElement function is used to generate HTML DOM elements, i.e. the above generate HTML structures, i.e. Hyperscript, so that only then createElement OF abbreviated h.
Vue.js inside createElement function, this effect is to generate a function VNode node, then obtain the VNode render function node, the function returns to the mount Vue.js, the rendered real DOM node, and the root mount.