Home  >  Q&A  >  body text

javascript - I don’t quite understand about render in vue.js


Why does new Vue need to use render in the future? Isn't render used to replace string templates?

黄舟黄舟2697 days ago822

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-31 10:40:22

    Render can indeed replace string templates. You can use render or template here. Render is highly efficient and template is easy to write, such as the following two forms.

    template: '<App/>'
    ---------------------------
      render:function (h) {
        return h(App)
      },

    The purpose of both writing methods is to instantiate an App component under the root element #app.

    reply
    0
  • Cancelreply