Skip to content
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

Functional Components #32

Merged
merged 2 commits into from
Dec 19, 2018
Merged

Conversation

abrenneke
Copy link
Contributor

The fix made in 935c59e doesn't actually work. It's because functional components in .vue files need to be compiled differently, so that the render function is functional, instead of using this.

If a component does not have a <script> tag, it shouldn't be treated as a functional component. Functional components should only be if you use <template functional>

All of that work has already been done in @vue/component-compiler-utils, so I've switched parsing and compiling over to that library, and taken a couple more ideas from vue-loader.

This MR fixes components without <script> tags, and adds support for functional components using <template functional>. Using @vue/component-compiler-utils may have other features/side-effects as well (however, all tests pass).

@abrenneke abrenneke changed the title True functional components using @vue/component-compiler-utils Functional Components Dec 12, 2018
package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
@vue/component-compiler-utils uses it internally
@jackmellis jackmellis merged commit fbd8fd7 into jackmellis:master Dec 19, 2018
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

Successfully merging this pull request may close these issues.

2 participants