Possible to use custom vue components in `component_vue`?
In
Voila
, it was possible to register custom vue-only components by registering them with ipyvue
, which made them available in the VuetifyTemplate
use case. Is there an analog when using Solara? That is, can I register a custom vue component, and have it available in the vue file passed to component_vue
? Registering it with ipyvue
as before does not seem to work.2 Replies
Hi Nick, good question, and I had to go back to some example where I had this running with jdaviz. What I did there was the following:
The problem with register_component_from_file is that is creates a widget directly. While in solara, you should create the widgets for each page/virtualkernel. Here is solved it by calling it directly in the top level Page component. It's a bit dirty, but in this case it works, because the Page component never gets re-executed. If you do have that in your case, maybe wrap you current top level Page component with a new one that will call register_component_from_file and then call the real Page component you originally had.
I originally thought that this kinda of work should be done in https://solara.dev/api/on_kernel_start but I am not 100% that works (please let me know)