12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

( ᐛ )σ「render: h => h(App) 」

Posted at
vue-cli/weboack-simple/main.js
new Vue({
  el: '#app',
  render: h => h(App)
})

vue-cliでwebpack-simpleテンプレートを利用すると見かける記述ですが、
なんじゃこりゃ、と思った人は私の他にもいるでしょう。
いませんか。

これが

render: function (createElement) {
    return createElement(App);
}

こうなって

render (createElement) {
    return createElement(App);
}

更にこう

render (h){
    return h(App);
}

最後、アロー関数に

render: h => h(App)

hhyperscriptのことだそう。

Explanation for render: h => h(App) please

12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?