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