Skip to content

[ Feat ] Vue render function support #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davelsan opened this issue Oct 29, 2019 · 0 comments
Closed

[ Feat ] Vue render function support #83

davelsan opened this issue Oct 29, 2019 · 0 comments

Comments

@davelsan
Copy link

davelsan commented Oct 29, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant