vue-best-practices

Guide Vue 3 development with Composition API and TypeScript best practices.

2|Updated Jan 5, 2024
One-click install
npx skills add https://github.com/wilfriedago/dotfiles --skill vue-best-practices-wilfriedago
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-best-practices
Source: https://github.com/wilfriedago/dotfiles/tree/main/agents/skills/vue-best-practices
Command: npx skills add https://github.com/wilfriedago/dotfiles --skill vue-best-practices-wilfriedago

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write better Vue.js applications by providing guidance on best practices, common pitfalls, and performance optimizations for Vue 3, Composition API, TypeScript, and more.

Core Features & Use Cases

  • Composition API Best Practices: Learn how to use ref, reactive, computed, and watchers effectively.
  • Component Design Patterns: Understand props, emits, slots, and provide/inject for robust component architecture.
  • Performance Optimization: Identify and fix common performance bottlenecks related to reactivity, rendering, and bundle size.
  • TypeScript Integration: Master typing for props, emits, refs, and other Composition API features.
  • Use Case: A developer is struggling with reactivity issues in a complex Vue component. They can consult this Skill for specific solutions related to destructuring reactive objects or using shallowRef for performance.

Quick Start

Review the best practices for using computed properties with arrays to avoid unexpected mutations.

Frequently Asked Questions about vue-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Vue 3 reactivity issues when destructuring reactive objects?

To fix Vue 3 reactivity issues when destructuring reactive objects, this Skill advises using specific solutions like `toRefs` to maintain reactivity or applying `shallowRef` for performance optimization in complex components.

What is the best way to type Vue Composition API props and emits with TypeScript?

The best way to type Vue Composition API props and emits with TypeScript is by following this Skill's TypeScript integration guidance, which helps master typing for refs, props, and emits to ensure robust component architecture.

How do I optimize Vue 3 performance and reduce rendering bottlenecks?

To optimize Vue 3 performance and reduce rendering bottlenecks, this Skill helps identify and fix common issues related to reactivity, rendering, and bundle size to improve application maintainability and speed.

When should I use provide/inject instead of props for Vue component design?

You should use provide/inject instead of props for Vue component design when building robust component architecture, as this Skill explains how to effectively combine slots and emits for complex state management.

Why do computed properties with arrays cause unexpected mutations in Vue 3?

Computed properties with arrays cause unexpected mutations in Vue 3 when best practices for immutability are ignored; this Skill provides specific guidance to review and avoid these common state management pitfalls.

Does this Vue best practices guide cover server-side rendering (SSR) setup?

Yes, this Vue best practices guide covers server-side rendering (SSR) setup, providing comprehensive guidance on SSR alongside Composition API, reactivity, and TypeScript to improve overall code quality.