Vue component property types (are union types possible?)


#1

I would like to write something like this
props: {
items: Object | Array
}

I’m writing a ListView component that can take either an Object or an Array, iterate through it, and render the items with a template.

This doesn’t work in vue.js, but is there a way to express what I’m trying to write?


#2

items: [Object, Array]