Skip to content

Expose createTextVNode() 's functionality in the API #5870

Closed
@green-coder

Description

@green-coder

What problem does this feature solve?

In the Vue Component's render() function, there is no normal way to create a VNode which represents naked text, same as what createTextVNode() would create.

This is needed when we want to generate things like:

<div>
  Hello <strong>Vue</strong>'s world.
</div>

What does the proposed API look like?

I propose to change the API in one of those 2 ways:

  1. Add a behavior to the h function which is given to the user in the render() function so that it can be used for creating a 'text VNode', and document it. I propose to use the null or undefined on the first parameter.

  2. Expose the createTextVNode() function (and why not also VNode()) somewhere inside Vue.

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

    Issue actions