Skip to content

docs: clarify computed return type checking - #3451

Open
KesleyDavid wants to merge 1 commit into
vuejs:mainfrom
KesleyDavid:docs/fix-3286-computed-typing
Open

docs: clarify computed return type checking#3451
KesleyDavid wants to merge 1 commit into
vuejs:mainfrom
KesleyDavid:docs/fix-3286-computed-typing

Conversation

@KesleyDavid

Copy link
Copy Markdown

Description of Problem

The computed() typing guide shows a generic argument, but generic inference does not perform excess property checks on an object literal. Readers who need that check have no documented alternative.

Closes #3286

Proposed Solution

Add a concise return type annotation example to the existing computed() typing section. It shows the TypeScript error for an extra object property while keeping the generic example intact.

Additional Information

  • Impact: readers can choose a return type annotation when they need stricter object-literal checks.
  • Root cause: this is TypeScript generic inference behavior, not a Vue runtime issue.
  • Validation: pnpm run build
  • AI assistance note: This small documentation clarification was drafted with AI assistance and reviewed by the contributor.

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit af3edae
🔍 Latest deploy log https://app.netlify.com/projects/vuejs/deploys/6a760ccf56d7aa0008d4fbd9
😎 Deploy Preview https://deploy-preview-3451--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 project configuration.

@KesleyDavid
KesleyDavid marked this pull request as ready for review August 7, 2026 16:54
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.

Suggestion: Clarify typing with computed<T> vs return annotation (excess property checks)

1 participant