vue-best-practices
MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.
- License 许可
- MIT
- 最近更新
- 2026-04-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- vue-best-practices
- license
- MIT
- metadata
- { "author": "github.com/vuejs-ai", "version": "17.0.0" }
- description
- MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.
02 资源文件 181
- 参考文档reference/animation-class-based-technique.md5.2 KB
- 参考文档reference/animation-key-for-rerender.md4.5 KB
- 参考文档reference/animation-state-driven-technique.md5.9 KB
- 参考文档reference/animation-transitiongroup-performance.md5.7 KB
- 参考文档reference/async-component-hydration-strategies.md4.0 KB
- 参考文档reference/async-component-loading-delay.md2.4 KB
- 参考文档reference/async-component-suspense-control.md2.5 KB
- 参考文档reference/async-component-vue-router.md2.8 KB
- 参考文档reference/attrs-hyphenated-property-access.md4.4 KB
- 参考文档reference/attrs-not-reactive.md4.2 KB
- 参考文档reference/avoid-prop-drilling-use-provide-inject.md5.7 KB
- 参考文档reference/component-events-dont-bubble.md5.5 KB
- 参考文档reference/component-naming-pascalcase.md3.1 KB
- 参考文档reference/composable-avoid-hidden-side-effects.md5.7 KB
- 参考文档reference/composable-composition-pattern.md6.8 KB
- 参考文档reference/composable-naming-return-pattern.md3.9 KB
- 参考文档reference/composable-options-object-pattern.md5.1 KB
- 参考文档reference/composable-readonly-state.md5.9 KB
- 参考文档reference/composable-vs-utility-functions.md5.5 KB
- 参考文档reference/composition-api-bundle-size-minification.md4.7 KB
- 参考文档reference/composition-api-code-organization.md5.9 KB
- 参考文档reference/composition-api-mixins-replacement.md5.2 KB
- 参考文档reference/composition-api-not-functional-programming.md3.8 KB
- 参考文档reference/composition-api-options-api-coexistence.md4.9 KB
- 参考文档reference/composition-api-vs-react-hooks-differences.md4.8 KB
- 参考文档reference/computed-array-mutation.md4.3 KB
- 参考文档reference/computed-conditional-dependencies.md4.3 KB
- 参考文档reference/computed-no-parameters.md4.4 KB
- 参考文档reference/computed-no-side-effects.md3.2 KB
- 参考文档reference/computed-properties-for-class-logic.md2.7 KB
- 参考文档reference/computed-return-value-readonly.md4.0 KB
- 参考文档reference/computed-vs-methods-caching.md3.6 KB
- 参考文档reference/definemodel-hidden-modifier-props.md4.2 KB
- 参考文档reference/definemodel-value-next-tick.md4.2 KB
- 参考文档reference/directive-arguments-read-only.md5.3 KB
- 参考文档reference/directive-avoid-on-components.md3.6 KB
- 参考文档reference/directive-cleanup-in-unmounted.md5.6 KB
- 参考文档reference/directive-function-shorthand.md4.5 KB
- 参考文档reference/directive-naming-v-prefix.md4.3 KB
- 参考文档reference/directive-prefer-declarative-templating.md5.6 KB
- 参考文档reference/directive-vs-component-decision.md6.1 KB
- 参考文档reference/directive-vue2-migration-hooks.md5.4 KB
- 参考文档reference/dynamic-component-registration-vite.md4.2 KB
- 参考文档reference/dynamic-components-with-keepalive.md5.5 KB
- 参考文档reference/emit-kebab-case-in-templates.md5.0 KB
- 参考文档reference/emit-validation-for-complex-payloads.md4.6 KB
- 参考文档reference/event-once-modifier-for-single-use.md4.6 KB
- 参考文档reference/exact-modifier-for-precise-shortcuts.md4.3 KB
- 参考文档reference/keepalive-component-name-requirement.md4.7 KB
- 参考文档reference/keepalive-memory-management.md4.9 KB
- 参考文档reference/keepalive-no-cache-removal-vue3.md4.5 KB
- 参考文档reference/keepalive-router-fresh-vs-cached.md5.7 KB
- 参考文档reference/keepalive-router-nested-double-mount.md5.0 KB
- 参考文档reference/keepalive-transition-memory-leak.md3.5 KB
- 参考文档reference/lifecycle-hooks-synchronous-registration.md3.8 KB
- 参考文档reference/mount-return-value.md2.6 KB
- 参考文档reference/mouse-button-modifiers-intent.md4.0 KB
- 参考文档reference/multiple-app-instances.md3.8 KB
- 参考文档reference/no-passive-with-prevent.md3.7 KB
- 参考文档reference/no-v-if-with-v-for.md3.8 KB
- 参考文档reference/perf-avoid-component-abstraction-in-lists.md4.8 KB
- 参考文档reference/perf-computed-object-stability.md4.7 KB
- 参考文档reference/perf-props-stability-update-optimization.md3.7 KB
- 参考文档reference/perf-ssr-ssg-for-page-load.md4.9 KB
- 参考文档reference/perf-v-once-v-memo-directives.md5.0 KB
- 参考文档reference/perf-virtualize-large-lists.md5.2 KB
- 参考文档reference/plugin-prefer-provide-inject-over-global-properties.md3.4 KB
- 参考文档reference/plugin-structure-install-method.md4.5 KB
- 参考文档reference/plugin-symbol-injection-keys.md4.3 KB
- 参考文档reference/plugin-typescript-type-augmentation.md4.1 KB
- 参考文档reference/prefer-local-component-registration.md4.1 KB
- 参考文档reference/prefer-props-emit-over-component-refs.md5.3 KB
- 参考文档reference/prefer-ref-over-reactive.md2.7 KB
- 参考文档reference/prop-boolean-casting-order.md3.4 KB
- 参考文档reference/prop-composable-reactivity-loss.md4.4 KB
- 参考文档reference/prop-destructured-watch-getter.md3.9 KB
- 参考文档reference/prop-validation-before-instance.md3.9 KB
- 参考文档reference/props-are-read-only.md5.1 KB
- 参考文档reference/provide-inject-mutations-in-provider.md5.1 KB
- 参考文档reference/provide-inject-symbol-keys.md5.7 KB
- 参考文档reference/reactive-destructuring.md2.6 KB
- 参考文档reference/reactivity-computed-over-watcheffect-mutations.md3.8 KB
- 参考文档reference/reactivity-external-state-integration.md4.5 KB
- 参考文档reference/reactivity-markraw-for-non-reactive.md4.6 KB
- 参考文档reference/reactivity-proxy-identity-hazard.md3.0 KB
- 参考文档reference/reactivity-same-tick-batching.md4.4 KB
- 参考文档reference/ref-value-access.md2.0 KB
- 参考文档reference/refs-in-collections-need-value.md3.0 KB
- 参考文档reference/render-function-avoid-internal-vnode-properties.md4.3 KB
- 参考文档reference/render-function-custom-directives.md4.4 KB
- 参考文档reference/render-function-event-modifiers.md4.6 KB
- 参考文档reference/render-function-functional-components.md4.2 KB
- 参考文档reference/render-function-v-for-keys-required.md3.8 KB
- 参考文档reference/render-function-v-model-implementation.md4.8 KB
- 参考文档reference/render-function-vnodes-must-be-unique.md3.4 KB
- 参考文档reference/rendering-excessive-rerenders-watch-vs-computed.md4.4 KB
- 参考文档reference/rendering-prefer-templates-over-render-functions.md4.0 KB
- 参考文档reference/rendering-render-function-h-import-vue3.md3.3 KB
- 参考文档reference/rendering-render-function-return-from-setup.md3.6 KB
- 参考文档reference/rendering-render-function-slots-as-functions.md4.0 KB
- 参考文档reference/rendering-resolve-component-for-string-names.md5.6 KB
- 参考文档reference/rendering-understand-vdom-block-structure.md4.2 KB
- 参考文档reference/self-referencing-component-name.md3.6 KB
- 参考文档reference/sfc-recommended-for-build-projects.md2.8 KB
- 参考文档reference/sfc-scoped-css-child-component-styling.md3.7 KB
- 参考文档reference/sfc-scoped-css-dynamic-content.md4.4 KB
- 参考文档reference/sfc-scoped-css-performance.md4.4 KB
- 参考文档reference/sfc-scoped-css-slot-content.md4.6 KB
- 参考文档reference/sfc-separation-of-concerns-colocate.md5.5 KB
- 参考文档reference/shallow-ref-for-performance.md3.6 KB
- 参考文档reference/slot-conditional-rendering-with-slots.md3.7 KB
- 参考文档reference/slot-define-slots-for-typescript.md4.0 KB
- 参考文档reference/slot-fallback-content-default-values.md3.2 KB
- 参考文档reference/slot-implicit-default-content.md3.4 KB
- 参考文档reference/slot-name-reserved-prop.md2.7 KB
- 参考文档reference/slot-named-scoped-explicit-default.md2.9 KB
- 参考文档reference/slot-render-scope-parent-only.md3.6 KB
- 参考文档reference/slot-renderless-components-vs-composables.md4.1 KB
- 参考文档reference/slot-v-slot-on-components-or-templates-only.md3.0 KB
- 参考文档reference/ssr-custom-directive-getssrprops.md5.3 KB
- 参考文档reference/ssr-platform-specific-apis.md6.8 KB
- 参考文档reference/state-ssr-cross-request-pollution.md6.9 KB
- 参考文档reference/style-binding-camelcase.md2.8 KB
- 参考文档reference/suspense-events-for-state-tracking.md4.1 KB
- 参考文档reference/suspense-experimental-api-stability.md2.5 KB
- 参考文档reference/suspense-fallback-not-immediate-on-revert.md3.3 KB
- 参考文档reference/suspense-nested-suspensible-prop.md3.8 KB
- 参考文档reference/suspense-nesting-order-with-router.md3.6 KB
- 参考文档reference/suspense-revert-only-on-root-change.md3.5 KB
- 参考文档reference/suspense-single-child-requirement.md2.0 KB
- 参考文档reference/tailwind-dynamic-class-generation.md3.1 KB
- 参考文档reference/teleport-css-positioning-issues.md4.1 KB
- 参考文档reference/teleport-disabled-for-responsive.md4.7 KB
- 参考文档reference/teleport-logical-hierarchy-preserved.md4.2 KB
- 参考文档reference/teleport-multiple-to-same-target.md3.8 KB
- 参考文档reference/teleport-scoped-styles-limitation.md3.8 KB
- 参考文档reference/template-functions-no-side-effects.md5.1 KB
- 参考文档reference/template-ref-unwrapping-top-level.md3.1 KB
- 参考文档reference/transition-animate-transform-opacity.md4.5 KB
- 参考文档reference/transition-group-flip-inline-elements.md3.9 KB
- 参考文档reference/transition-group-key-requirement.md3.2 KB
- 参考文档reference/transition-group-move-animation-position-absolute.md3.7 KB
- 参考文档reference/transition-group-no-default-wrapper-vue3.md3.9 KB
- 参考文档reference/transition-group-no-mode-prop.md4.3 KB
- 参考文档reference/transition-group-staggered-animations.md4.8 KB
- 参考文档reference/transition-js-hooks-done-callback.md6.0 KB
- 参考文档reference/transition-key-for-same-element.md4.7 KB
- 参考文档reference/transition-mode-out-in.md5.2 KB
- 参考文档reference/transition-nested-duration.md4.9 KB
- 参考文档reference/transition-reusable-scoped-style.md5.2 KB
- 参考文档reference/transition-router-view-appear.md4.8 KB
- 参考文档reference/transition-single-element-slot.md3.1 KB
- 参考文档reference/transition-type-when-mixed.md4.3 KB
- 参考文档reference/transition-unmount-hook-timing.md4.2 KB
- 参考文档reference/ts-component-ref-typeof-instancetype.md6.1 KB
- 参考文档reference/ts-custom-directive-type-augmentation.md6.5 KB
- 参考文档reference/ts-defineemits-type-based-syntax.md4.7 KB
- 参考文档reference/ts-defineprops-boolean-default-false.md5.4 KB
- 参考文档reference/ts-defineprops-imported-types-limitations.md5.9 KB
- 参考文档reference/ts-defineprops-type-based-declaration.md4.4 KB
- 参考文档reference/ts-event-handler-explicit-typing.md5.8 KB
- 参考文档reference/ts-provide-inject-injection-key.md6.5 KB
- 参考文档reference/ts-reactive-no-generic-argument.md4.7 KB
- 参考文档reference/ts-shallowref-for-dynamic-components.md5.9 KB
- 参考文档reference/ts-template-ref-null-handling.md5.2 KB
- 参考文档reference/ts-template-type-casting.md5.0 KB
- 参考文档reference/ts-withdefaults-mutable-factory-function.md4.5 KB
- 参考文档reference/updated-hook-performance.md4.8 KB
- 参考文档reference/v-for-use-computed-for-filtering.md3.1 KB
- 参考文档reference/v-html-xss-security.md3.3 KB
- 参考文档reference/v-if-vs-v-show-performance.md3.6 KB
- 参考文档reference/v-model-vue3-breaking-changes.md4.1 KB
- 参考文档reference/watch-deep-performance.md3.9 KB
- 参考文档reference/watch-deep-same-object-reference.md4.3 KB
- 参考文档reference/watch-flush-timing.md4.9 KB
- 参考文档reference/watch-immediate-option.md3.5 KB
- 参考文档reference/watch-reactive-property-getter.md2.9 KB
- 参考文档reference/watch-vs-watcheffect.md4.7 KB
- 参考文档reference/watcheffect-async-dependency-tracking.md4.5 KB
- 参考文档reference/watcheffect-flush-post-for-refs.md4.2 KB
- 参考文档skill-report.json620.0 KB
03 SKILL.md 正文
Vue 3 best practices, common gotchas, and performance optimization.
Reactivity
- Accessing ref() values without .value in scripts → See ref-value-access
- Destructuring reactive() objects, losing reactivity → See reactive-destructuring
- Choosing between ref() and reactive() for state → See prefer-ref-over-reactive
- Accessing refs inside arrays and collections → See refs-in-collections-need-value
- Large objects or external library data overhead → See shallow-ref-for-performance
- Using nested refs in template expressions → See template-ref-unwrapping-top-level
- Comparing reactive objects with === operator → See reactivity-proxy-identity-hazard
- Library instances breaking in reactive state → See reactivity-markraw-for-non-reactive
- Expecting watchers to fire for each state change → See reactivity-same-tick-batching
- Integrating external state management libraries → See reactivity-external-state-integration
- Deriving state with watchEffect instead of computed → See reactivity-computed-over-watcheffect-mutations
Computed
- Computed getter is making API calls or mutations → See computed-no-side-effects
- Mutating computed values causes lost changes unexpectedly → See computed-return-value-readonly
- Computed property doesn't update when expected → See computed-conditional-dependencies
- Sorting or reversing arrays destroys original data → See computed-array-mutation
- Expensive operations running too frequently every render → See computed-vs-methods-caching
- Trying to pass arguments to computed properties → See computed-no-parameters
- Complex conditions bloating inline class bindings → See computed-properties-for-class-logic
Watchers
- Need to watch a reactive object property → See watch-reactive-property-getter
- Large nested data structures causing performance issues → See watch-deep-performance
- Dependencies accessed after await not tracking → See watcheffect-async-dependency-tracking
- Need to access updated DOM in watchers → See watch-flush-timing
- Uncertain whether to use watch or watchEffect → See watch-vs-watcheffect
- Duplicating initial calls and watch callbacks → See watch-immediate-option
- Can't compare old and new values correctly → See watch-deep-same-object-reference
- Template refs appearing null or stale → See watcheffect-flush-post-for-refs
Components
- Prop values being changed from a child component → See props-are-read-only
- Grandparent can't listen to grandchild emitted events → See component-events-dont-bubble
- Distinguishing Vue components from native elements → See component-naming-pascalcase
- Recursive component needs to reference itself → See self-referencing-component-name
- Bundle includes components that aren't used → See prefer-local-component-registration
- Tight coupling through component ref access → See prefer-props-emit-over-component-refs
Props & Emits
- Boolean prop not parsing as expected → See prop-boolean-casting-order
- Composable doesn't update when props change → See prop-composable-reactivity-loss
- Destructured props not updating watchers → See prop-destructured-watch-getter
- Prop validation needs component instance data → See prop-validation-before-instance
- Event name inconsistency in templates and scripts → See emit-kebab-case-in-templates
- Event payloads need validation during development → See emit-validation-for-complex-payloads
Templates
- Rendering untrusted user content as HTML → See v-html-xss-security
- Filtering or conditionally hiding list items → See no-v-if-with-v-for
- Functions in templates modifying data unexpectedly → See template-functions-no-side-effects
- Performance issues with filtered or sorted lists → See v-for-use-computed-for-filtering
- Deciding between v-if and v-show for conditionals → See v-if-vs-v-show-performance
Forms & v-model
- Need to handle v-model modifiers in child → See definemodel-hidden-modifier-props
- Need to use updated value immediately after change → See definemodel-value-next-tick
- Migrating Vue 2 components to Vue 3 → See v-model-vue3-breaking-changes
Events & Modifiers
- Need to handle same event only one time → See event-once-modifier-for-single-use
- Keyboard shortcuts fire with unintended modifier combinations → See exact-modifier-for-precise-shortcuts
- Using left-handed mouse or non-standard input devices → See mouse-button-modifiers-intent
- Preventing default browser action and scroll performance together → See no-passive-with-prevent
Lifecycle
- Lifecycle hooks don't execute asynchronously → See lifecycle-hooks-synchronous-registration
- Expensive operations slow performance drastically → See updated-hook-performance
Slots
- Accessing child component data in slot content → See slot-render-scope-parent-only
- Mixing named and scoped slots together → See slot-named-scoped-explicit-default
- Using v-slot on native HTML elements → See slot-v-slot-on-components-or-templates-only
- Empty wrapper elements rendering unnecessarily → See slot-conditional-rendering-with-slots
- Scoped slot props lack TypeScript type safety → See slot-define-slots-for-typescript
- Rendering empty component slots without defaults → See slot-fallback-content-default-values
- Confused about which slot content goes where → See slot-implicit-default-content
- Expecting name property in scoped slot props → See slot-name-reserved-prop
- Choosing between renderless components and composables → See slot-renderless-components-vs-composables
Provide/Inject
- String keys collide in large applications → See provide-inject-symbol-keys
- State mutations scattered across components → See provide-inject-mutations-in-provider
- Passing props through many component layers → See avoid-prop-drilling-use-provide-inject
Attrs
- Accessing hyphenated attributes in JavaScript code → See attrs-hyphenated-property-access
- Watching fallthrough attributes for changes with watch() → See attrs-not-reactive
Composables
- Composable has unexpected side effects affecting external state → See composable-avoid-hidden-side-effects
- Building complex logic from smaller focused composables → See composable-composition-pattern
- Inconsistent composable names or destructuring loses reactivity → See composable-naming-return-pattern
- Composable has many optional parameters or confusing argument order → See composable-options-object-pattern
- Need to prevent uncontrolled mutations of composable state → See composable-readonly-state
- Unsure whether logic belongs in composable or utility function → See composable-vs-utility-functions
Composition API
- Optimizing production bundle size and performance → See composition-api-bundle-size-minification
- Composition API code becoming scattered and hard to maintain → See composition-api-code-organization
- Fixing naming conflicts and unclear data origins in mixins → See composition-api-mixins-replacement
- Applying functional patterns incorrectly to Vue state → See composition-api-not-functional-programming
- Gradually migrating large Options API codebase → See composition-api-options-api-coexistence
- Coming from React, over-engineering Vue patterns unnecessarily → See composition-api-vs-react-hooks-differences
Directives
- Storing state across directive hooks → See directive-arguments-read-only
- Applying custom directives to Vue components → See directive-avoid-on-components
- Creating intervals or event listeners in directives → See directive-cleanup-in-unmounted
- Simplifying directives with identical behavior → See directive-function-shorthand
- Using custom directives in script setup → See directive-naming-v-prefix
- Choosing between custom and built-in directives → See directive-prefer-declarative-templating
- Deciding between directives and components → See directive-vs-component-decision
- Migrating Vue 2 directives to Vue 3 → See directive-vue2-migration-hooks
Transitions
- Wrapping multiple elements or components in transitions → See transition-single-element-slot
- Transitioning between same element types without animation → See transition-key-for-same-element
- Using JavaScript animations without calling done callback → See transition-js-hooks-done-callback
- Animating lists with TransitionGroup without unique keys → See transition-group-key-requirement
- Performance problems with janky list animations → See transition-animate-transform-opacity
- Move animations failing on inline list elements → See transition-group-flip-inline-elements
- List items jumping instead of smoothly animating → See transition-group-move-animation-position-absolute
- Vue 2 to Vue 3 transition layout breaks unexpectedly → See transition-group-no-default-wrapper-vue3
- Trying to sequence list animations with mode prop → See transition-group-no-mode-prop
- Creating cascading delays for list item animations → See transition-group-staggered-animations
- Overlapping elements or layout jumping during transitions → See transition-mode-out-in
- Nested transition animations cutting off prematurely → See transition-nested-duration
- Reusable transition components with scoped styles breaking → See transition-reusable-scoped-style
- RouterView transitions unexpectedly animating on page load → See transition-router-view-appear
- Mixing CSS transitions and animations causing timing issues → See transition-type-when-mixed
- Component cleanup not firing during fast transition replacements → See transition-unmount-hook-timing
Animation
- Need to animate elements staying in DOM → See animation-class-based-technique
- Animations not triggering on content changes → See animation-key-for-rerender
- Building interactive animations with user input → See animation-state-driven-technique
- Animating list changes causing noticeable lag → See animation-transitiongroup-performance
KeepAlive
- Using KeepAlive without proper cache limits or cleanup → See keepalive-memory-management
- KeepAlive include/exclude props not matching cached components → See keepalive-component-name-requirement
- Need to programmatically remove component from KeepAlive cache → See keepalive-no-cache-removal-vue3
- Users see stale cached content when expecting fresh page data → See keepalive-router-fresh-vs-cached
- Child components mount twice with nested Vue Router routes → See keepalive-router-nested-double-mount
- Memory grows when combining KeepAlive with Transition animations → See keepalive-transition-memory-leak
- Dynamic component state resets when switching between them → See dynamic-components-with-keepalive
Async Components
- Setting up Vue Router route component loading → See async-component-vue-router
- Async component options ignored by parent Suspense → See async-component-suspense-control
- Improving Time to Interactive with SSR apps → See async-component-hydration-strategies
- Loading spinner flashing on fast networks → See async-component-loading-delay
Render Functions
- Render function from setup doesn't update reactively → See rendering-render-function-return-from-setup
- Same vnode appearing multiple times in tree → See render-function-vnodes-must-be-unique
- Rendering lists in render functions without keys → See render-function-v-for-keys-required
- Implementing .stop, .prevent in render functions → See render-function-event-modifiers
- Two-way binding on components in render functions → See render-function-v-model-implementation
- Using string names for components in render functions → See rendering-resolve-component-for-string-names
- Accessing vnode internals like el or shapeFlag → See render-function-avoid-internal-vnode-properties
- Creating simple stateless presentational components → See render-function-functional-components
- Applying custom directives in render functions → See render-function-custom-directives
- Excessive rerenders from watchers or deep watchers → See rendering-excessive-rerenders-watch-vs-computed
- Choosing render functions over templates → See rendering-prefer-templates-over-render-functions
- Migrating Vue 2 render functions to Vue 3 → See rendering-render-function-h-import-vue3
- Passing slot content to h() incorrectly → See rendering-render-function-slots-as-functions
- Understanding Vue's vdom optimization blocks → See rendering-understand-vdom-block-structure
Teleport
- Modal breaks with parent CSS transforms → See teleport-css-positioning-issues
- Content needs different layout on mobile → See teleport-disabled-for-responsive
- Unsure if props/events work through teleport → See teleport-logical-hierarchy-preserved
- Multiple modals targeting same container → See teleport-multiple-to-same-target
- Scoped styles not applying to teleported content → See teleport-scoped-styles-limitation
Suspense
- Want to track Suspense loading states programmatically → See suspense-events-for-state-tracking
- Planning Suspense usage in production applications → See suspense-experimental-api-stability
- Fallback not showing when content changes → See suspense-fallback-not-immediate-on-revert
- Nesting Suspense components together → See suspense-nested-suspensible-prop
- Combining Suspense with Router, Transition, KeepAlive → See suspense-nesting-order-with-router
- Nested async component not showing loading indicator → See suspense-revert-only-on-root-change
- Multiple async components in single Suspense → See suspense-single-child-requirement
TypeScript
- Declaring props with TypeScript in composition API components → See ts-defineprops-type-based-declaration
- Providing default values to mutable prop types → See ts-withdefaults-mutable-factory-function
- Typing reactive state with ref unwrapping concerns → See ts-reactive-no-generic-argument
- Accessing DOM elements after component mounts → See ts-template-ref-null-handling
- Typing refs to child Vue components → See ts-component-ref-typeof-instancetype
- Using custom directives with TypeScript support → See ts-custom-directive-type-augmentation
- Declaring component events with full type safety → See ts-defineemits-type-based-syntax
- Handling optional boolean props in TypeScript → See ts-defineprops-boolean-default-false
- Using imported types safely in defineProps → See ts-defineprops-imported-types-limitations
- Handling DOM events with strict TypeScript checking → See ts-event-handler-explicit-typing
- Sharing data between components with type safety → See ts-provide-inject-injection-key
- Storing Vue components in reactive state → See ts-shallowref-for-dynamic-components
- Working with union types in Vue templates → See ts-template-type-casting
SSR
- User data leaking between server requests → See state-ssr-cross-request-pollution
- Code runs on both server and browser environments → See ssr-platform-specific-apis
- Custom directives not displaying on server-rendered HTML → See ssr-custom-directive-getssrprops
Performance
- Many list items re-rendering unnecessarily during state changes → See perf-props-stability-update-optimization
- Rendering hundreds or thousands of items causing DOM performance issues → See perf-virtualize-large-lists
- Static content re-evaluated on every parent component update → See perf-v-once-v-memo-directives
- List performance degrading from deeply nested component structure → See perf-avoid-component-abstraction-in-lists
- Computed properties returning objects triggering effects unexpectedly → See perf-computed-object-stability
- Page load metrics suffering from client-side JavaScript execution delay → See perf-ssr-ssg-for-page-load
SFC (Single File Components)
- Starting a Vue project with a build setup → See sfc-recommended-for-build-projects
- Styling child component elements with scoped CSS → See sfc-scoped-css-child-component-styling
- Styling content added dynamically with v-html → See sfc-scoped-css-dynamic-content
- Optimizing scoped CSS selector performance → See sfc-scoped-css-performance
- Styling content passed through component slots → See sfc-scoped-css-slot-content
- Organizing component template, logic, and styles → See sfc-separation-of-concerns-colocate
- Binding inline styles with property names → See style-binding-camelcase
- Building Tailwind classes with string concatenation → See tailwind-dynamic-class-generation
Plugins
- Global properties not available in setup function → See plugin-prefer-provide-inject-over-global-properties
- Creating a new Vue plugin from scratch → See plugin-structure-install-method
- Preventing collisions between multiple plugins → See plugin-symbol-injection-keys
- Global properties missing TypeScript autocomplete support → See plugin-typescript-type-augmentation
App Configuration
- Need to chain app configuration methods after mount → See mount-return-value
- Vue only controlling specific page sections → See multiple-app-instances
- Migrating dynamic component registration to Vite → See dynamic-component-registration-vite
04 同仓库更多 Skills
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
vue-testing-best-practices
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
vue-router-best-practices
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.
vue-pinia-best-practices
Pinia stores, state management patterns, store setup, and reactivity with stores.
vue-options-api-best-practices
Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only.
vue-development-guides
A collection of best practices and tips for developing applications using Vue.js. This skill MUST be apply when developing, refactoring or reviewing Vue.js or Nuxt projects.