Skip to content

Commit 45aa4ac

Browse files
gamperlyyx990803
authored andcommitted
add an any and a union type example for typescript prop annotation (#1121)
1 parent d49b7dd commit 45aa4ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/guide/typescript-support.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,17 @@ interface Book {
247247
const Component = defineComponent({
248248
props: {
249249
name: String,
250+
id: [Number, String],
250251
success: { type: String },
251252
callback: {
252253
type: Function as PropType<() => void>
253254
},
254255
book: {
255256
type: Object as PropType<Book>,
256257
required: true
258+
},
259+
metadata: {
260+
type: null // metadata is typed as any
257261
}
258262
}
259263
})

0 commit comments

Comments
 (0)