Struggling to find answers to my unique question, I'm attempting to create an interface where users can drag or input images using Vue. I've developed a component called Card
, which combines Vue and Bulma to create card-like objects with props
for title
and content
. Easy enough to use when the data is pre-loaded text or image.
However, my challenge lies in embedding another vue component, specifically the PictureInput
component from vue-picture-input
on NPM, within the Card
. I've delved into reactive props and dynamic components in the Vue documentation, but neither addresses this scenario directly.
Code:
Card.vue:
// Code snippet for the Card.vue goes here
ImageInput.vue:
// Code snippet for the ImageInput.vue goes here
My attempt at dynamically generating the PictureInput
object and passing it as the content
prop to Card
failed due to errors related to cyclic object values and missing methods in the PictureInputClass
object. Even simplifying to
<Card :title="makeCardTitle()" :content="PictureInput"/>
resulted in undefined references during rendering. Perhaps changing content
to a named slot could be a solution?
I value Vue's flexibility in component reusability and integration, hence my persistence in finding a way to make the PictureInput
a child of the Card
component without drastic template modifications.