api-typings
api-typings copied to clipboard
组件属性是自定义的类型该如何定义?
例如
Component({
properties: {
coupon: CouponBO
},
我想通过this.properties.coupon
获得类型提示,应该怎么写呢?
同,应该怎么写呢
可能是这样
const data: { a: string[] } = { a: [] }
const properties: {
b: ArrayConstructor,
c: { type: ArrayConstructor, value: any[] },
} = {
b: Array,
c: { type: Array, value: [] },
}
Component({ data, properties })
@jq94666 你可以了吗