I have a dynamic component that loads it based on the type of each component and props that I passed are used inside all the components
<div>
<component
:is="getComponentName(attribute.type.toLowerCase())"
:cell-value="listItem[attribute.name]"
:attribute="attribute"
:is-read-only="isReadOnly"
:row-key-id="listItem.keyId"
/>
</div>
and components are loaded from within a json where each type is assigned a component
{
"dropdown" : {
"shouldLoadComponent" : "BaseDropDown"
},
"assigned" :{
"shouldLoadComponent" : "BaseDropDown"
},
"textbox" : {
"shouldLoadComponent" : "BaseInput"
},
"label": {
"shouldLoadComponent" : "BaseLabel"
},
"switch": {
"shouldLoadComponent" : "BaseSwitch"
},
"time": {
"shouldLoadComponent" : "BaseLabel"
},
"status" : {
"shouldLoadComponent" : "BaseLabel"
},
"comment": {
"shouldLoadComponent" : "BaseLabel"
},
"action": {
"shouldLoadComponent" : "BaseLabel"
},
"personalimage":{
"shouldLoadComponent" : "BaseLabel"
}
}
The main problem is that there are a number of non-common props and they are not used within all components
What is the best way to do this?
Now this is a problem for events as well, as each event component has its own unique