What does render:h = h (App) mean?

Source: Internet
Author: User

When learning Vue.js, a Vue project was created with VUE-CLI, and a line of code in the Main.js file did not know what it meant. Search online to get the following answers:

Reference one: https://www.cnblogs.com/longying2008/p/6408753.html

Reference two: https://www.cnblogs.com/whkl-m/p/6970859.html

Main.js File Contents

Import vue from ' Vue ' import App from './app ' Vue.config.productionTip = False    //Set False to prevent Vue from generating production tips at startup */ Eslint-disable no-new */New Vue ({  el: ' #app ',  render:h = h (APP)    })

Note:/* eslint-disable no-new * * This is not a comment, in JS, the new object needs to be assigned to a value (variable), when instantiated with Vue, do not need to assign a value (variable), so you need to assign a rule to the new This line of code in Vue adds this comment, skipping the check of this code rule through eslint-disable. is one of the common techniques of eslint.

Anyway

Render:h = h (App)   This is an arrow function is affirmative, that corresponds to the es5 form is what???

As follows:

{   render:h = h (App)}

Equivalent to:

{   render:h =>{        return H (App)    }}

Equivalent to:

{    render:function (h) {        return H (App);    }}

That

{    render:function (createelement) {        return createelement (APP);}    }

createelement parameters

Actually read the official document of createelement, I still do not understand createelement usage. How many parameters do the CreateElement method have? What are the meanings and types of each parameter?

Cases:

<! DOCTYPE html>

  

What does render:h = h (App) mean?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.