Skip to content
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

typo. #3014

Merged
merged 1 commit into from
Sep 11, 2024
Merged

typo. #3014

merged 1 commit into from
Sep 11, 2024

Conversation

zhangenming
Copy link
Contributor

Description of Problem

I think it's a forget

Proposed Solution

Additional Information

Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 2d4b867
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/66e146b9d8e7fe00084bb7c8
😎 Deploy Preview https://deploy-preview-3014--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AloisSeckar
Copy link
Contributor

It is not forgotten. As long as the props are defined via defineProps macro inside <script setup>, they are automatically unwrapped and available directly in <template>. See for example HERE. Your update would also work, but it is not necessary.

In the current example, the assignments into props and emits are de-facto useless, as we are not working with them further in <script setup> section. The code could be re-written as:

<script setup>
defineProps(['modelValue'])
defineEmits(['update:modelValue'])
</script>

<template>
  <input
    :value="modelValue"
    @input="$emit('update:modelValue', $event.target.value)"
  >
</template>

@NataliaTepluhina Do you think this will improve clarity? Or is it rather against coding style established in other examples?

Copy link
Member

@bencodezen bencodezen left a comment

Choose a reason for hiding this comment

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

Great catch. You're totally right. Thanks for the PR!

@bencodezen bencodezen merged commit 6fcf44c into vuejs:main Sep 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants