मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)6.0k · #14442

pinia

यह क्या करती है

यह स्किल बताती है कि Pinia का उपयोग करके Vue ऐप्स में साझा डेटा कैसे व्यवस्थित किया जाए। Pinia Vue के लिए आधिकारिक state लाइब्रेरी है। यह उन डेवलपरों के लिए है जिन्हें ऐप के कई हिस्सों में एक ही डेटा चाहिए।

कब इस्तेमाल करें

  • ✓जब आप Vue ऐप बना रहे हैं और कई कंपोनेंट्स में साझा डेटा चाहिए।
  • ✓जब आप state, getters और actions वाले स्टोर सेट करना चाहते हैं।
  • ✓जब आपको Pinia स्टोर की जाँच या विस्तार करना है।

Skill का लिंक

https://github.com/antfu/skills/blob/main/skills/pinia/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/antfu/skills/blob/main/skills/pinia/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“Pinia स्टोर बनाइए जो मेरे शॉपिंग कार्ट के आइटम और कुल रकम सभी पेजों पर रखे।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट ऐसे स्टोर सेट करता है जो साझा डेटा रखते हैं और उसे बदलने वाले actions, और यह Pinia के टाइप, टेस्टिंग और विस्तार पर मार्गदर्शन का पालन करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Pinia

Pinia is the official state management library for Vue, designed to be intuitive and type-safe. It supports both Options API and Composition API styles, with first-class TypeScript support and devtools integration.

The skill is based on Pinia v4.0.3, generated at 2026-09-25.

Core References

Topic Description Reference
Stores Defining stores, state, getters, actions, storeToRefs, subscriptions core-stores

Features

Extensibility

Topic Description Reference
Plugins Extend stores with custom properties, state, and behavior features-plugins

Composability

Topic Description Reference
Composables Using Vue composables within stores (VueUse, etc.) features-composables
Composing Stores Store-to-store communication, avoiding circular dependencies features-composing-stores

Best Practices

Topic Description Reference
Testing Unit testing with @pinia/testing, mocking, stubbing best-practices-testing
Outside Components Using stores in navigation guards, plugins, middlewares best-practices-outside-component

Advanced

Topic Description Reference
SSR Server-side rendering, state hydration advanced-ssr
Nuxt Nuxt integration, auto-imports, SSR best practices advanced-nuxt
HMR Hot module replacement for development advanced-hmr

Key Recommendations

  • Prefer Setup Stores for complex logic, composables, and watchers
  • Use storeToRefs() when destructuring state/getters to preserve reactivity
  • Actions can be destructured directly - they're bound to the store
  • Call stores inside functions not at module scope, especially for SSR
  • Add HMR support to each store for better development experience
  • Use @pinia/testing for component tests with mocked stores
अक्सर पूछे जाने वाले सवाल

क्या Pinia केवल Vue के लिए है?

यह Vue ऐप्स के लिए बनी है, और मार्गदर्शन इसी को कवर करता है।

क्या मैं अपने स्टोर की टेस्टिंग कर सकता हूँ?

हाँ। मार्गदर्शन में स्टोर की टेस्टिंग और मॉकिंग शामिल है।

क्या यह TypeScript के साथ काम करता है?

हाँ। Pinia टाइप-सेफ़ बनाई गई है और TypeScript को सपोर्ट करती है।

जानकारी

लेखक का मूल विवरण

Pinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or implementing store patterns in Vue apps.

repo: antfu/skills

लोकप्रियता

GitHub स्टार
6.0k
रैंकिंग में स्थान
#14442
लाइसेंस
MIT
अपडेट की गई
30/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

antfu-create-pr

6.0k

आपके एजेंट को आपकी ब्रांच से GitHub पर साफ़ pull request खोलने में मदद करती है, जिसमें बदला गया और कारण का सरल सारांश होता है।

कोडिंगसामान्य कोडिंग

antfu-issue-triage

6.0k

आपके एजेंट को खुले GitHub इश्यू और pull request छाँटने में मदद करती है, डुप्लिकेट और पहले से ठीक हो चुके आइटम पहचानकर, और कार्रवाई से पहले आपसे पूछकर।

कोडिंगसामान्य कोडिंग

antfu-query

6.0k

आपके एजेंट को किसी योजना या विचार पर एक-एक करके सवाल पूछने देती है, जब तक आप दोनों एक स्पष्ट और परखी हुई समझ पर न पहुँच जाएँ।

प्रोडक्टिविटीटास्क और प्रोजेक्ट

antfu-simplify

6.0k

आपके एजेंट को आपके कोड बदलावों को सबसे छोटे सही रूप में घटाने में मदद करती है, जिसमें जो ज़रूरी नहीं है उसे हटाया जाता है।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills