From 9b3500bc1c9c8be2b8c40df468fae8cf4fd06f9b Mon Sep 17 00:00:00 2001 From: Osvaldo Perez <463779+xi-osman@users.noreply.github.com> Date: Sat, 19 Sep 2020 12:15:29 -0500 Subject: [PATCH 1/2] Resolve props template usage composition api --- src/guide/composition-api-setup.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/guide/composition-api-setup.md b/src/guide/composition-api-setup.md index db559bf930..dd24852b70 100644 --- a/src/guide/composition-api-setup.md +++ b/src/guide/composition-api-setup.md @@ -111,6 +111,9 @@ If `setup` returns an object, the properties on the object can be accessed in th import { ref, reactive } from 'vue' export default { + props: { + collectionName: String + }, setup(props) { const readersNumber = ref(0) const book = reactive({ title: 'Vue 3 Guide' }) @@ -118,7 +121,8 @@ If `setup` returns an object, the properties on the object can be accessed in th // expose to template return { readersNumber, - book + book, + props } } } From b4b73872d919f3343f357c002983ffd91579ba25 Mon Sep 17 00:00:00 2001 From: Osvaldo Perez <463779+xi-osman@users.noreply.github.com> Date: Mon, 21 Sep 2020 00:24:01 -0500 Subject: [PATCH 2/2] No need to return props explicitly. --- src/guide/composition-api-setup.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/guide/composition-api-setup.md b/src/guide/composition-api-setup.md index dd24852b70..29bc1d7456 100644 --- a/src/guide/composition-api-setup.md +++ b/src/guide/composition-api-setup.md @@ -104,7 +104,7 @@ If `setup` returns an object, the properties on the object can be accessed in th ```vue-html