What is the difference between these writing methods of vue configuration?

what is the difference between these writing methods of vue configuration? A little confused:

Type 1: the main.js of vue-cli 3.0says this:

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("-sharpapp");

type 2: an online blog is written like this

new Vue({
    el: "-sharpapp",
    router,
    axios,
    store,
    apolloProvider,
    template: "<App/>",
    components: { App }
});

Type 3: vue-apollo says: ide/installation.html-sharpapollo-provider" rel=" nofollow noreferrer "> https://akryum.github.io/vue-.

new Vue({
  el: "-sharpapp",
  provide: apolloProvider.provide(),
  render: h => h(App),
})

Type 4: there is no new Vue (), in the app.js of Baidu lavas, but there is the following paragraph: document https://github.com/lavas-proj.

.
export function createApp() {
    let router = createRouter();
    let store = createStore();
    let App = Vue.extend({
        router,
        store,
        ...AppComponent
    });
    return {App, router, store};
}



question:

In

1, 1 and 3, there is a sentence render: h = > h (App) . What does this sentence mean? What is h?
2. In the second way of writing, there are the following two sentences. What does it mean?

template: "<App/>",
components: { App }

3. In the second way, there is a sentence apolloProvider, , and in the third way, there is a sentence provide: apolloProvider.provide (), . What"s the difference between them?

4, the fourth Baidu lavas writing method can not understand, please help explain.

Thank you all!

Apr.29,2021

  • what does it mean that there is a sentence "render: h = > h (App)," in the first and third ways of writing? What is h?

this is the new syntax in ES6 Arrow function is equivalent to

  

with regard to question 1, if you are referring to the runtime version of vue, there is no template compilation function, so you cannot use templates, you should use rendering functions.

Menu