Replies: 4 comments
-
Yes, functional components are pure, synchronous functions where props go in, and vnodes come out. For what "simple operation" do you want to use a async functional component,? You haven't provided a use case for your feature request |
Beta Was this translation helpful? Give feedback.
-
My use case is to submit a form to the backend as part of vue router that would route to another page. So I used ChatGPT to convert a template-less component
what I would rather have had was something like this (where I take out some of the boiler plate parts like onMounted, defineComponent etc.
|
Beta Was this translation helpful? Give feedback.
-
That doesn't look like a component, it looks like a VueRouter Navigation Guard? Is there a reason this could not be a guard? |
Beta Was this translation helpful? Give feedback.
-
If it was a navigation guard then it will be triggered per entry of the I could make it a
But that means my route configuration would be larger I'd rather simply put components to keep it consistent with the rest of the routes.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What problem does this feature solve?
FunctionalComponent
are useful for simple routes that simply do an operation e.g. load pinia with random data then route. However, it does not appear to work correctly when the functional component isasync
.What does the proposed API look like?
Beta Was this translation helpful? Give feedback.
All reactions