--- name: spin-component overview: 实现 Spin 加载组件(形态一:独立指示器;形态二:包裹内容+遮罩,且不破坏内部布局),配套 demo 与注册。 design: architecture: framework: vue styleKeywords: - 加载反馈 - 轻量遮罩 - 居中指示器 fontSystem: fontFamily: system-ui heading: size: 14px weight: 500 subheading: size: 12px weight: 400 body: size: 12px weight: 400 colorSystem: primary: - "#0f172b" background: - transparent text: - "#86909c" functional: - "#0f172b" todos: - id: spin-tokens content: 用 [skill:antdv-next] 确认形态二结构,tokens.css 新增 --fms-spin-size status: completed - id: spin-style content: 创建 spin/index.scss(指示器旋转动画 + 形态二容器/轻量遮罩/绝对居中指示器 + reduced-motion) status: completed dependencies: - spin-tokens - id: spin-component content: "创建 spin/spin.vue(spinning/delay/description + #indicator/#description/默认插槽 + delay 定时器清理 + ARIA)" status: completed dependencies: - spin-style - id: spin-demo content: 创建 demo/spin.vue 并注册到 App.vue「反馈」分类与 demoMap status: completed dependencies: - spin-component - id: spin-verify content: 用 [skill:playwright-cli] 实测形态二内部布局零偏移 + oxlint 静态检查并汇报 status: completed dependencies: - spin-demo --- ## 用户需求 实现 Spin 加载中组件,支持两种形态: - **形态一(无子元素)**:独立加载指示器,可带文案,如 `` - **形态二(有子元素)**:包裹内容并覆盖半透明遮罩,如 `<表格/>` **重点要求**:形态二必须做好——不能因为添加 Spin 导致内部元素位置/尺寸错乱。遮罩和指示器应绝对定位脱离文档流,内容容器只加 `position: relative`,加载时内容降透明并禁用交互,布局保持不变。 ## 核心功能 - `spinning`(Boolean,默认 true):是否加载中 - `delay`(Number,默认 0):延迟显示(毫秒),防短请求闪烁,卸载时清理定时器 - `description`(String):加载文案,显示在指示器下方 - 插槽:`#indicator` 自定义指示器(默认 LoaderCircle 旋转)、`#description` 自定义文案、默认插槽(传入则启用形态二) - 形态二:内容容器加载时 `opacity` 降低 + `pointer-events: none` 禁交互 + 轻量遮罩;指示器与文案绝对居中 - ARIA:容器 `aria-busy`、指示器 `role="status"` + `aria-label="加载中"` - 不提供 size 枚举(遵循开发规范 7.1) ## 技术栈 - Vue 3 `