Skip to content

Docs: fix invalid mapState example and magicValue usage#3102

Merged
posva merged 1 commit into
vuejs:v3from
tandddian:patch-1
Feb 10, 2026
Merged

Docs: fix invalid mapState example and magicValue usage#3102
posva merged 1 commit into
vuejs:v3from
tandddian:patch-1

Conversation

@tandddian

@tandddian tandddian commented Feb 10, 2026

Copy link
Copy Markdown

This PR fixes two issues in the mapState example in state.md:

  1. Add a missing trailing comma after ...mapState(...) to avoid a syntax error when copying the example.
  2. Fix magicValue to use store.count instead of this.count, which is not reliably defined on the component instance and causes runtime warnings.

before fixed

微信图片_20260210121223_4_377 微信图片_20260210121223_5_377

after fixed

image

Summary by CodeRabbit

Release Notes

  • Documentation
    • Corrected code examples in the State Management documentation to improve accuracy and consistency of API usage patterns.

Fix magicValue computation to use store.count instead of this.count.
@netlify

netlify Bot commented Feb 10, 2026

Copy link
Copy Markdown

Deploy Preview for pinia-official ready!

Name Link
🔨 Latest commit a84ab5c
🔍 Latest deploy log https://app.netlify.com/projects/pinia-official/deploys/698ac764111fa4000881fcb5
😎 Deploy Preview https://deploy-preview-3102--pinia-official.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.

@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Minor documentation corrections in the Chinese core concepts guide. A trailing comma was added to mapState syntax for consistency, and a code example was corrected to reference the store parameter instead of this context within a computed function.

Changes

Cohort / File(s) Summary
Documentation Code Examples
packages/docs/zh/core-concepts/state.md
Fixed mapState code example by adding trailing comma for proper syntax and correcting this.count to store.count reference in computed function.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested reviewers

  • posva

Poem

🐰 A comma here, a reference there,
In docs we fix with utmost care,
The store now shines, both bright and clear,
Example code without a fear! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes in the pull request: fixing an invalid mapState example (trailing comma) and correcting the magicValue usage (store.count vs this.count).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@posva posva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@posva posva merged commit f2c3f66 into vuejs:v3 Feb 10, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 Triaging to ✅ Done in Pinia Roadmap Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants