When should I use render: h => h (App)?

In docs, I don't quite understand when I should use a function render: h => h(App).

For example, I have a very simple Vue application:

import Vue from 'vue'
import App from './App.vue'

new Vue({
    el: '#app',
    components: { App }
})

In the case when I need to add the code render: h => h(App):?

+4
source share
1 answer

In the above example, it App.vuerepresents the main shell of the application - all other components .vuewill be associated with files.

So, in your Vue instance, you defined a component object and added an application component, but how would you accurately model this component and display it?

  • It is not a .vue file, therefore you do not have a template option, it is a clean .js file
  • <App></App> template, ,

- , VueJS hood.It , .

:

import Vue from 'vue'
import App from './App.vue'

new Vue({
    el: '#app',
    ...App
})

, :

Vue HTML . , JavaScript. ,

+8

Source: https://habr.com/ru/post/1671148/


All Articles