NuxtN
Nuxt12mo ago
Felix

Is it possible to inject (typed) variables on a component by component basis?

I have a form builder use case where a form is comprised of hundreds of steps. each step works on a slice of the form data, so each step should have a typed interface to interact with the bit of state it manages. i could achieve this by calling useStepFormData<"Step1"> etc in every step component, but I am wondering if I can automate this using a nuxt plugin where the plugin effectively writes the above line at the top of the setup script?
Was this page helpful?