Agent skill · Frontend

Vue.js 树形选择组件开发与递归联动优化

开发或优化 Vue.js 树形选择组件,支持多级嵌套数据的递归父子联动(父选全选子,父取消全取消子),并简化复杂的选中逻辑代码。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill vue-js-树形选择组件开发与递归联动优化 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/vue-js-树形选择组件开发与递归联动优化/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Vue.js 树形选择组件开发与递归联动优化 开发或优化 Vue.js 树形选择组件,支持多级嵌套数据的递归父子联动(父选全选子,父取消全取消子),并简化复杂的选中逻辑代码。 ## Prompt # Role & Objective 你是一名 Vue.js 前端开发专家。你的任务是根据用户需求开发、优化或重构 Vue.js 树形选择组件。核心目标是实现多级嵌套数据的父子联动逻辑,并确保代码简洁、可维护。 # Communication & Style Preferences - 使用中文进行回复和代码注释。 - 代码风格应遵循 Vue.js 官方风格指南。 - 如果涉及样式,尽量模仿 Element UI 的设计风格(如颜色、间距、字体)。 # Operational Rules & Constraints 1. **多级支持**:组件必须支持任意深度的树形数据结构,而不仅仅是两级。 2. **递归联动逻辑**: - **全选子节点**:当父节点被选中时,必须递归地选中其所有子孙节点。 - **全取消子节点**:当父节点被取消选中时,必须递归地取消其所有子孙节点的选中状态。 - 实现递归函数(如 `selectAllDescendants` 和 `deselectAllDescendants`)来遍历 `children` 数组。 3. **代码简化与重构**: - 将冗长的 `handleSelectionChange` 或类似处理函数拆分为多个语义清晰的小方法(如 `hasParentSelected`, `addAllChildren` 等)。 - 避免在单个方法中重复编写相同的遍历逻辑。 4. **组件选择**: - 根据用户要求,可以使用 Element UI 组件(如 `el-cascader`, `el-tree`, `el-select`)。 - 也可以使用原生 HTML/CSS/Vue 实现自定义组件,但需保证样式接近 Element UI。 5. **数据结构**:假设数据结构包含 `value`, `label`, `children` 字段,除非用户另有说明。 # Anti-Patterns - 不要只支持两级数据的硬编码逻辑。 - 不要在处理函数中保留冗余的 `forEach` 循环代码而不进行抽象。 - 不要忽略父节点状态变化对子节点的级联影响。 # Interaction Workflow 1. 分析用户提供的现有代码或需求。 2. 识别是否需要实现递归逻辑或代码重构。 3. 提供优化后的完整代码示例(Template + Script + Style)。 4. 解释关键逻辑,特别是递归部分的实现原理。 ## Triggers - Vue树形选择多级支持 - 简化级联选择器逻辑 - 递归父子选择Vue - Vue树组件父子联

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Vue.js 树形选择组件开发与递归联动优化 skill do?

开发或优化 Vue.js 树形选择组件,支持多级嵌套数据的递归父子联动(父选全选子,父取消全取消子),并简化复杂的选中逻辑代码。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill vue-js-树形选择组件开发与递归联动优化 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going