Create demo page

From wot-ui/wot-ui · View interactive version

Create demo page is an AI agent skill from the GitHub repository wot-ui/wot-ui. 为组件创建演示页面并统一组织结构。用户要求新建/重构组件 Demo、统一展示顺序或用 demo-group 与 demo-group-item 编排时调用。

How to use this skill

Skill file

组件演示页面编写技能

本技能用于在 wot-ui 中创建或重构组件演示页,输出统一、可迁移、可维护的示例结构。

默认遵循 wot-ui-component-baseline 中的共享约束。

职责边界

何时使用

目标输出

固定组织顺序

按以下顺序编排分组:

  1. 组件类型(Type)
  2. 组件状态(State)
  3. 组件变体(Variant)
  4. 组件样式(Style)
  5. 特殊样式(Special Style)

按需分组(内部规则:仅在满足条件时启用;对外标题不标注“可选”):

条目编排规则

模板结构

<template>
  <page-wraper>
    <view class="page-xxx">
      <demo-group title="组件类型">
        <demo-group-item title="类型">
          <!-- 示例 -->
        </demo-group-item>
      </demo-group>
    </view>
  </page-wraper>
</template>

实施步骤

  1. 盘点组件能力:props / slots / events / states / variants。
  2. 映射分组:先放入五个核心分组,再判断可选分组是否启用。
  3. 编排条目:每个 item 保持单变量,形成对照。
  4. 复用渲染:对重复矩阵使用数组 + v-for。
  5. 收敛样式:统一按钮间距与行间距,减少内联样式。
  6. 校验结果:确认示例覆盖、命名一致、页面无语法/类型错误。

数据驱动约定

命名与文案约定

样式约定

验收清单

示例参考(Button)

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.