DEV Community

Discussion on: Vue.js Pattern for Async Requests: Using Renderless Components

 
tiagosmartinho profile image
Tiago Martinho

ty :p

a problem occured. On some pages, the props data is expected to be an object, but on others it is an array.

I thought I'd give the property multiple types, or is there a better solution?

Solution

props: {
    data: Object | Array
},
Thread Thread
 
maoberlehner profile image
Markus Oberlehner

LGTM ;)