Vue

uni-helper/skills/skills/vue

作者 uni-helper15909ff061a3无许可证108 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7个月前更新

Vue.js progressive JavaScript framework. Use when building Vue components, working with reactivity (ref, reactive, computed, watch), or implementing Vue Composition API patterns.

AI 生成的概览

使用组合式 API、script setup 和 TypeScript 构建 Vue 3.5+ 应用的参考指南。

功能
提供 Vue.js 开发主题的结构化参考,包括响应式系统(ref、reactive、computed、watch、watchEffect),组件特性如 props、emits、插槽、v-model 和生命周期钩子,以及可复用模式如组合式函数、自定义指令和模板引用。还涵盖进阶主题,如 provide/inject 和带 Suspense 的异步组件,以及 TypeScript 用法。文末给出关键建议,例如使用带 lang ts 的 script setup,并优先使用 ref 而非 reactive。
适用场景
在构建或处理 Vue 组件、处理响应式或组合式 API 模式,或查阅 Vue 组件、组合式函数与 TypeScript 约定时使用。
运行要求
无需脚本或运行时依赖,仅为说明性参考资料。代理不需要安装包、凭据或网络访问。

Vue

The skill is based on Vue 3.5+, generated at 2026-01-28.

Vue is a progressive JavaScript framework for building user interfaces. It builds on standard HTML, CSS, and JavaScript with intuitive API and world-class documentation. The Composition API with <script setup> and TypeScript is the recommended approach for building Vue applications.

Core References

TopicDescriptionReference
Reactivity Systemref, reactive, computed, watch, and watchEffectcore-reactivity [blocked]

Components

TopicDescriptionReference
PropsDeclare and validate component props with TypeScriptcomponents-props [blocked]
Events (Emits)Emit custom events from componentscomponents-emits [blocked]
SlotsPass template content to child componentscomponents-slots [blocked]
v-modelTwo-way binding on custom componentscomponents-v-model [blocked]
Lifecycle HooksRun code at specific component lifecycle stagescomponents-lifecycle [blocked]

Features

Script Setup & TypeScript

TopicDescriptionReference
Script SetupComposition API syntactic sugar for SFCsfeatures-script-setup [blocked]
TypeScriptType-safe Vue components with Composition APIfeatures-typescript [blocked]

Reusability

TopicDescriptionReference
ComposablesEncapsulate and reuse stateful logicfeatures-composables [blocked]
Custom DirectivesLow-level DOM manipulation directivesfeatures-directives [blocked]
Template RefsDirect DOM and component instance accessfeatures-template-refs [blocked]

Advanced

TopicDescriptionReference
Provide/InjectDependency injection across component treeadvanced-provide-inject [blocked]
Async & SuspenseTop-level await pitfalls, async components, Suspenseadvanced-async-suspense [blocked]

Key Recommendations

  • Use <script setup lang="ts"> for all components
  • Prefer ref() over reactive() for declaring state
  • Use type-based prop declarations with interfaces
  • Use defineModel() for v-model (3.4+)
  • Destructure props reactively (3.5+) for cleaner code
  • Extract composables for reusable stateful logic

来源与署名

来源:uni-helper/skills位于skills/vue提交15909ff

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架