Skip to content

[ Feat ] Vue render function support #83

Closed
@davelsio

Description

@davelsio

Would it be possible to add completion support for the class binding within Vue render function?

Explanation

The createElement function and its h alias accept a data object, within which we can pass a class field that uses the same API as v-bind:class. These are plain .js files, but the extension does not seem to work in this case.

createElement(
    'div',
    {
        class: 'flex bg-gray-700 ...'
    },
    [ vNode ]
);

Alternatively, it is also possible to use JSX within the render function, using the respective Babel plugin. I guess it would make even more sense to provide completion support here.

new Vue({
  el: '#demo',
  render: function (h) {
    return (
      <AnchoredHeading level={1}>
        <span>Hello</span> world!
      </AnchoredHeading>
    )
  }
})

Some folks at issue #58 have already mentioned this over there, but I'm not sure how well that relates to the specifics of JSX inside Vue.

Update

It appears that JSX support is already there, since the template syntax is the same and the extension is active in plain javascript files.

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