Skip to content

docs: explain toRef property fallback values - #3499

Open
smg99 wants to merge 1 commit into
vuejs:mainfrom
smg99:docs/to-ref-default-value
Open

smg99 wants to merge 1 commit into
vuejs:mainfrom
smg99:docs/to-ref-default-value

Conversation

@smg99

@smg99 smg99 commented Nov 18, 2026

Copy link
Copy Markdown

Description of Problem

The toRef() reference lists the optional defaultValue argument without saying when it is used or whether it writes to the source property.

Proposed Solution

Explain that an undefined property reads as the supplied fallback. Reading does not initialize the source property, and a write to the ref still updates the source.

Additional Information

Verified on Vue 3.5.44 with missing and undefined properties, assignment through the ref, and a source property set to null.

@netlify

netlify Bot commented Nov 18, 2026

Copy link
Copy Markdown

👷 Deploy request for vuejs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1eec205

This branch has not been deployed

No deployments
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.

1 participant