luwanquan / babel-preset-vca-jsx

Automatically imports createElement as h when writing JSX and functional syntax that supports only setup() and template refs that supports setup()
https://codesandbox.io/s/babel-preset-vca-jsx-example-7k5xs
75 stars 8 forks source link

VCA-JSX not co-op with Babel @vue/app anymore #3

Closed TrungRueta closed 4 years ago

TrungRueta commented 4 years ago

Hi, i hope you guy good health!

I want report 2 problem:

  1. In our document explain how to add vca-jsx into babel config with vue cli = @vue/app but in vue cli nowadays they use @vue/cli-plugin-babel/preset. Can we update document ?

  2. document explains that with functional component we have format function with first argument is props. but actually when render i see first argument is CTX (FunctionalRenderContext). After a hour debug source code i found that because @vue present take care convert jsx into a vue object with first argument of render = ctx, and vca skipped transpile later. I'm not good enough to modify babel plugin code, can you guy take a look. I found that functional component should return function, while i return direct JSX.Element and it only take care from vue cli present. This is not bug, it my fault but i think we should leave notice in document.

Thank you!

mesqueeb commented 4 years ago

+1

luwanquan commented 4 years ago

Thanks for the suggestion

I have updated to v0.3.3,Fixed @vue/babel-sugar-v-model@1.1.2 calling this in setup()

All your suggestions have been accepted and updated