Skip to content

What does h mean? #6

Closed
Closed
@rwu823

Description

@rwu823

Note the h function, which is a shorthand for a Vue instance's $createElement method, must be in the scope where the JSX is. Since this method is passed to component render functions as the first argument, in most cases you'd do this:

Vue.component('jsx-example', {
  render (h) { // <-- h must be in scope
    return <div id="foo">bar</div>
  }
})

I just want to know why it is called h and how to remember it :)

Activity

yyx990803

yyx990803 commented on Jul 15, 2016

@yyx990803
Member

It comes from the term "hyperscript", which is commonly used in many virtual-dom implementations. "Hyperscript" itself stands for "script that generates HTML structures" because HTML is the acronym for "hyper-text markup language".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yyx990803@rwu823

        Issue actions

          What does `h` mean? · Issue #6 · vuejs/babel-plugin-transform-vue-jsx