From 821c1cf89aa4c498b23e8c3999c6473873324ee9 Mon Sep 17 00:00:00 2001 From: Lukas Gamper Date: Fri, 2 Jul 2021 22:52:02 +0200 Subject: [PATCH] add an any and a union type example for typescript prop annotation --- src/guide/typescript-support.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/guide/typescript-support.md b/src/guide/typescript-support.md index 53e2593f5c..7180ee6c4f 100644 --- a/src/guide/typescript-support.md +++ b/src/guide/typescript-support.md @@ -247,6 +247,7 @@ interface Book { const Component = defineComponent({ props: { name: String, + id: [Number, String], success: { type: String }, callback: { type: Function as PropType<() => void> @@ -254,6 +255,9 @@ const Component = defineComponent({ book: { type: Object as PropType, required: true + }, + metadata: { + type: null // metadata is typed as any } } })