Is there any difference between the two ways of writing vue?

 new Vue({
  el: "-sharpapp",
  router,
    //render: h =>h(Layout),
  template: "<Layout/>",
  components: { Layout }
})
There is no difference between

render: h = > h (Layout), and template:"< Layout/ >".

Mar.14,2021

makes no difference, in the end, it is the above form


the way to use template requires the full version of vue (including compiler), and the way to use the render function, only the runtime version of vue is needed, that is to say, if your output file wants to be smaller, you can use the latter way.

Menu