mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 01:59:20 +08:00
14 lines
1.1 KiB
Plaintext
14 lines
1.1 KiB
Plaintext
---
|
|
description: Ant Design Vue Spin 与可滚动 flex/grid 布局的配合方式,避免列表无法滚动
|
|
globs: ecom-dmb-frontend/apps/web-antd/**/*.vue
|
|
alwaysApply: false
|
|
---
|
|
|
|
# Spin 与侧栏/向导内滚动
|
|
|
|
- **不要用 `<Spin :spinning>` 整块包住「可滚动列表」所在的主内容区**。`Spin` 会渲染 `ant-spin-nested-loading` / `ant-spin-container`,内层常见 `overflow: hidden` 或高度链断裂,导致子元素虽有 `overflow-y: auto` 但**滚轮/触控滚不动**。
|
|
- **推荐**:加载态拆细——例如字段定义用独立 `ref`(如 `fieldDefsLoading`),只在列表上方或占位区放小号 `Spin`/文案;提交操作用按钮 `:loading` + `message.loading`,避免大 Spin 套滚动容器。
|
|
- **布局**:侧栏/向导内滚动依赖整条 flex 链上的 **`min-h-0` / `minmax(0,1fr)`**,列表容器用 **`flex-1 min-h-0 overflow-y-auto`**;需要时可加 **`overscroll-behavior-y: contain`**(如 Tailwind `overscroll-y-contain`)减少滚动链冒泡到外层页面。
|
|
|
|
参考实现:`ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order-import/components/ImportTaskWizard.vue`(订单导入向导)。
|