Vue badge skill

From jiushiwon/wg-skills · View interactive version

Vue badge skill is an AI agent skill from the GitHub repository jiushiwon/wg-skills. Vue 徽标组件技能。用于消息计数、状态指示、角标。5 种形态:圆点/数字/文字/红点/最大值。触发词:徽标、徽章、badge、小红点、消息计数、角标。

How to use this skill

Skill file

vue-badge-skill

Vue 徽标组件技能。基于 vue-theme-skill 的 Token 实现。

核心组件

| 组件 | 说明 |

|------|------|

| base-badge | 通用徽标(5 种形态) |

形态矩阵

| 形态 | 说明 | 场景 |

|------|------|------|

| dot | 圆点 | 在线状态、待处理 |

| count | 数字 | 消息数量、购物车 |

| text | 文字 | NEW、HOT、热门 |

| max | 最大值 | 99+、999+ |

| dot-pulse | 脉冲红点 | 重要通知 |

Props

| 属性 | 类型 | 默认值 | 说明 |

|------|------|--------|------|

| type | 'dot' \| 'count' \| 'text' \| 'max' | 'count' | 徽标类型 |

| value | number \| string | 0 | 数值或文字 |

| max | number | 99 | 最大显示值 |

| showZero | boolean | false | 是否显示 0 |

| pulse | boolean | false | 是否脉冲动画 |

| color | string | 'error' | 颜色主题 |

使用示例

<!-- 数字徽标 -->
<base-badge :value="5" />
<base-badge :value="100" :max="99" />

<!-- 圆点徽标 -->
<base-badge type="dot" />

<!-- 文字徽标 -->
<base-badge type="text" value="NEW" />

<!-- 脉冲红点 -->
<base-badge type="dot" :pulse="true" />

<!-- 购物车数量 -->
<base-badge :value="cartCount" :max="99" />

样式 Token

| 变量 | 说明 |

|------|------|

| --badge-bg | 徽标背景色 |

| --badge-text | 徽标文字色 |

| --badge-size | 徽标尺寸 |

| --badge-font-size | 字号 |

跨技能协同

| 技能 | 用途 |

|------|------|

| vue-theme-skill | Token 样式 |

| frontend-icon-skill | 图标徽标组合 |

| vue-button-skill | 按钮徽标组合 |

| vue-menu-skill | 菜单徽标 |

| vue-dropdown-skill | 下拉徽标 |

红线

文件结构

vue-badge-skill/
├── SKILL.md
├── README.md
├── base-badge.md
├── components/
│   └── BaseBadge.vue
└── demo-components/
    └── base-badge/
        └── html/
            └── 00-showcase.html
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.