-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Support for methods in functional component + template #8142
Comments
Supports the "methods" object in functional components for better functional-template usability re vuejs#8142
Vue functional component it define as a stateless component. In this case, it is not applicable to functional components , you can pack it into a stateful component . |
@yunfong And to add, making functions accessible via the functional-template doesn't make the component stateful. I'm happy to open a PR when the FR is approved. |
Could you open the issue in vue loader instead, please? |
@posva It's just adding the The template should be able to access the methods with a syntax like this: |
What problem does this feature solve?
There is no way for me to use functions in a functional template.
While I can declare methods outside the scope of the functional-component definition and access it within the render method (Snippet 1), I cannot access it when I use a functional template (Snippet 2).
Snippet 1:
Snippet 2: Doesn't work
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: