vuejs / vuejs/docs

Props (Composition API)

Open
#2,185 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vue
Stars
3.2k
Forks
5k
Avg merge
14d 17h
Merged PRs (30d)
1

Description

https://vuejs.org/guide/components/props.html#props-declaration

When it comes to the example of passing an object of props, it isn't clear that you still need to use const props = if you want to use those props.

The example should instead be:

// in <script setup>
const props = defineProps({
  title: String,
  likes: Number
})

And the TypeScript example:

<script setup lang="ts">
const props = defineProps<{
  title?: string
  likes?: number
}>()
</script>

:octocat:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked Props Declaration documentation section and compare its object and TypeScript examples with the issue. Update both examples so the props declaration is assigned to const props, and consider the issue complete when the displayed snippets make that usage clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.