vue-best-practices

软件研发 前端与组件 23 文件 EN 原文

MUST be used for Vue.js tasks. Strongly recommen

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.

说明语言:英文

来源vuejs-aiskills ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/vuejs-ai/skills --skill vue-best-practices

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: vue-best-practices 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. license: MIT metadata: author: github.com/vuejs-ai version: "19.1.0" ---

Vue Best Practices Workflow

Use this skill as an instruction set. Follow the workflow in order unless the user explicitly asks for a different order.

Core Principles

1) Confirm architecture before coding (required)

1.1 Must-read core references (required)

1.2 Plan component boundaries before coding (required)

For a non-trivial feature or structural refactor, sketch responsibilities, state owners, and the contracts that cross their boundaries. For local fixes, preserve existing boundaries unless they obstruct the change.

2) Apply essential Vue foundations (required)

These are essential, must-know foundations. Apply all of them in every Vue task using the core references already loaded in section 1.1.

Reactivity

SFC structure and template safety

Choose useful boundaries

Component data flow

Composables

3) Consider optional features only when requirements call for them

3.1 Standard optional features

Do not add these by default. Load the matching reference only when the requirement exists.

3.2 Less-common optional features

Use these only when there is explicit product or technical need.

4) Run performance optimization after behavior is correct

Performance work is a post-functionality pass. Do not optimize before core behavior is implemented and verified.

5) Final self-check before finishing

同类技能
angular-migrationbazel-build-optimizationbefore-you-buildbetter-accessibilitybetter-uibuild-designdataverse-python-quickstartdataverse-python-usecase-builder
本页内容来自开源项目 vuejs-ai, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。