Skip to content

Resolve props template usage composition api #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 21, 2020

Conversation

xi-osman
Copy link
Contributor

Description of Problem

Was not able to run the provided composition template code snippet and realized its because the props object was not returned.

Proposed Solution

Added the props property and also returned props so the template can reference it.

Additional Information

@NataliaTepluhina
Copy link
Member

@xi-osman thank you for the contribution! However, the snippet works without returning props explicitly: https://codesandbox.io/s/setup-with-props-phsye?file=/src/Book.vue

@NataliaTepluhina NataliaTepluhina added the state: awaiting-feedback Needs more input before further actions can be taken label Sep 20, 2020
@xi-osman
Copy link
Contributor Author

@NataliaTepluhina Awesome that worked! Would we want to remove the 'props.' from the template and just leave 'collectionName' then?

<!-- MyBook.vue -->
<template>
  <div>{{ props.collectionName }}: {{ readersNumber }} {{ book.title }}</div>
</template>

@NataliaTepluhina
Copy link
Member

@xi-osman yes, that is a mistake I guess 😅 Would you mind doing this change on your pull request?

@xi-osman
Copy link
Contributor Author

@NataliaTepluhina Sure! already submitted a new commit 😎

Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing it!

@NataliaTepluhina NataliaTepluhina merged commit c84c5f3 into vuejs:master Sep 21, 2020
nick-lai pushed a commit to nick-lai/docs-next that referenced this pull request Dec 2, 2020
* Resolve props template usage composition api

* No need to return props explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: awaiting-feedback Needs more input before further actions can be taken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants