I’m currently working on a project with Vue.js and have a problem with using slots.
I have two components: PageView.vue
and SlotComponentView.vue
In SlotComponentView.vue
, there is a slot named Content that is used in PageView.vue
. For example, I add an input field to this slot, which is correctly inserted into the component at runtime.
Now, I want to read and save the content of this slot (specifically the value of the input field) from SlotComponentView.vue
at runtime. The goal is to implement something like a “savable filter”. The filter has a slot where I can place any input (such as text fields), and in SlotComponentView.vue
, I want to use a button to read and save those inputs.
Does anyone have an idea how I can access the content of a slot at runtime in order to process the data in the parent component?
Thanks in advance!