x-next 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_CODING.md +6 -5
- package/AI_USAGE/catalog.md +106 -105
- package/AI_USAGE/components/alert-api.md +48 -0
- package/AI_USAGE/components/alert.md +222 -3
- package/AI_USAGE/components/bar-chart-api.md +177 -0
- package/AI_USAGE/components/bar-chart.md +297 -3
- package/AI_USAGE/components/boxicons.md +147 -0
- package/AI_USAGE/components/button-api.md +144 -0
- package/AI_USAGE/components/button.md +447 -3
- package/AI_USAGE/components/charts.md +81 -0
- package/AI_USAGE/components/checkbox-api.md +145 -0
- package/AI_USAGE/components/checkbox.md +365 -3
- package/AI_USAGE/components/color-picker-api.md +52 -0
- package/AI_USAGE/components/color-picker.md +211 -3
- package/AI_USAGE/components/config-provider-api.md +38 -0
- package/AI_USAGE/components/config-provider.md +250 -3
- package/AI_USAGE/components/date-picker-api.md +1114 -0
- package/AI_USAGE/components/date-picker.md +378 -3
- package/AI_USAGE/components/dialog-api.md +142 -0
- package/AI_USAGE/components/dialog.md +284 -3
- package/AI_USAGE/components/draggable-api.md +146 -0
- package/AI_USAGE/components/draggable.md +259 -0
- package/AI_USAGE/components/drawer-api.md +78 -0
- package/AI_USAGE/components/drawer.md +227 -0
- package/AI_USAGE/components/dropdown-api.md +529 -0
- package/AI_USAGE/components/dropdown.md +392 -3
- package/AI_USAGE/components/empty-api.md +36 -0
- package/AI_USAGE/components/empty.md +227 -3
- package/AI_USAGE/components/finicon.md +88 -0
- package/AI_USAGE/components/form-api.md +524 -0
- package/AI_USAGE/components/form.md +454 -0
- package/AI_USAGE/components/grid-api.md +527 -0
- package/AI_USAGE/components/grid.md +224 -0
- package/AI_USAGE/components/heatmap-api.md +122 -0
- package/AI_USAGE/components/heatmap.md +220 -0
- package/AI_USAGE/components/icon-api.md +4707 -0
- package/AI_USAGE/components/icon.md +257 -0
- package/AI_USAGE/components/image-api.md +440 -0
- package/AI_USAGE/components/image.md +465 -0
- package/AI_USAGE/components/input-api.md +184 -0
- package/AI_USAGE/components/input-number-api.md +66 -0
- package/AI_USAGE/components/input-number.md +294 -0
- package/AI_USAGE/components/input-tag-api.md +114 -0
- package/AI_USAGE/components/input-tag.md +482 -0
- package/AI_USAGE/components/input.md +293 -3
- package/AI_USAGE/components/layout-api.md +147 -0
- package/AI_USAGE/components/layout.md +230 -0
- package/AI_USAGE/components/line-chart-api.md +197 -0
- package/AI_USAGE/components/line-chart.md +279 -3
- package/AI_USAGE/components/link-api.md +42 -0
- package/AI_USAGE/components/link.md +197 -0
- package/AI_USAGE/components/menu-api.md +516 -0
- package/AI_USAGE/components/menu.md +268 -0
- package/AI_USAGE/components/message-api.md +215 -0
- package/AI_USAGE/components/message-box-api.md +108 -0
- package/AI_USAGE/components/message-box.md +268 -3
- package/AI_USAGE/components/message.md +231 -3
- package/AI_USAGE/components/network-api.md +91 -0
- package/AI_USAGE/components/network.md +378 -0
- package/AI_USAGE/components/notification-api.md +236 -0
- package/AI_USAGE/components/notification.md +275 -3
- package/AI_USAGE/components/pagination-api.md +62 -0
- package/AI_USAGE/components/pagination.md +380 -3
- package/AI_USAGE/components/pie-chart-api.md +109 -0
- package/AI_USAGE/components/pie-chart.md +245 -3
- package/AI_USAGE/components/popconfirm-api.md +75 -0
- package/AI_USAGE/components/popconfirm.md +231 -3
- package/AI_USAGE/components/popover-api.md +75 -0
- package/AI_USAGE/components/popover.md +208 -3
- package/AI_USAGE/components/popup-api.md +75 -0
- package/AI_USAGE/components/popup.md +52 -0
- package/AI_USAGE/components/progress-api.md +44 -0
- package/AI_USAGE/components/progress.md +248 -3
- package/AI_USAGE/components/radio-api.md +165 -0
- package/AI_USAGE/components/radio.md +259 -3
- package/AI_USAGE/components/rate-api.md +54 -0
- package/AI_USAGE/components/rate.md +233 -3
- package/AI_USAGE/components/resize-box-api.md +56 -0
- package/AI_USAGE/components/resize-box.md +231 -0
- package/AI_USAGE/components/scrollbar-api.md +77 -0
- package/AI_USAGE/components/scrollbar.md +218 -0
- package/AI_USAGE/components/select-api.md +758 -0
- package/AI_USAGE/components/select.md +640 -3
- package/AI_USAGE/components/skeleton-api.md +85 -0
- package/AI_USAGE/components/skeleton.md +150 -0
- package/AI_USAGE/components/slider-api.md +51 -0
- package/AI_USAGE/components/slider.md +233 -3
- package/AI_USAGE/components/space-api.md +38 -0
- package/AI_USAGE/components/space.md +145 -0
- package/AI_USAGE/components/spin-api.md +43 -0
- package/AI_USAGE/components/spin.md +205 -0
- package/AI_USAGE/components/steps-api.md +111 -0
- package/AI_USAGE/components/steps.md +201 -3
- package/AI_USAGE/components/switch-api.md +58 -0
- package/AI_USAGE/components/switch.md +290 -3
- package/AI_USAGE/components/table-api.md +2919 -0
- package/AI_USAGE/components/table.md +1414 -0
- package/AI_USAGE/components/tabs-api.md +135 -0
- package/AI_USAGE/components/tabs.md +308 -3
- package/AI_USAGE/components/tag-api.md +124 -0
- package/AI_USAGE/components/tag.md +292 -0
- package/AI_USAGE/components/textarea-api.md +55 -0
- package/AI_USAGE/components/textarea.md +326 -3
- package/AI_USAGE/components/time-picker-api.md +137 -0
- package/AI_USAGE/components/time-picker.md +271 -3
- package/AI_USAGE/components/time-range-selector-api.md +44 -0
- package/AI_USAGE/components/time-range-selector.md +355 -0
- package/AI_USAGE/components/timeline-api.md +93 -0
- package/AI_USAGE/components/timeline.md +312 -0
- package/AI_USAGE/components/tooltip-api.md +77 -0
- package/AI_USAGE/components/tooltip.md +182 -0
- package/AI_USAGE/components/trend-chart-api.md +119 -0
- package/AI_USAGE/components/trend-chart.md +335 -0
- package/AI_USAGE/components/trigger-api.md +124 -0
- package/AI_USAGE/components/trigger.md +185 -0
- package/AI_USAGE/components/upload-api.md +200 -0
- package/AI_USAGE/components/upload.md +711 -3
- package/AI_USAGE/components/watermark-api.md +87 -0
- package/AI_USAGE/components/watermark.md +200 -0
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +35 -7
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +33651 -5
- package/CHANGELOG.md +18 -0
- package/dist/_utils/inherit-component-type.d.ts +11 -0
- package/dist/components/date-picker/index.d.ts +420 -5
- package/dist/components/form-input/index.d.ts +617 -2
- package/dist/components/layout/index.d.ts +689 -1
- package/dist/components/menu/index.d.ts +786 -1
- package/dist/es/_utils/inherit-component-type.js +6 -0
- package/dist/es/components/date-picker/index.js +18 -17
- package/dist/es/components/form-input/index.js +12 -11
- package/dist/es/components/layout/index.js +10 -9
- package/dist/es/components/menu/hooks/use-level.js +5 -5
- package/dist/es/components/menu/index.js +13 -10
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/package.json +10 -5
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Scrollbar AI 使用
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
先读 [通用接入](../core.md)。公开导出:`Scrollbar`;主要模型:无。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./scrollbar-api.md),包含本组件族全部子组件和别名。
|
|
7
|
+
|
|
8
|
+
按需样式:`x-next/style/scrollbar-v2`(包含 base.css、scrollbar-v2.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
|
|
9
|
+
|
|
10
|
+
## 场景用法
|
|
11
|
+
|
|
12
|
+
以下示例从本地 `src/docs/components/scrollbar.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./scrollbar-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
|
|
13
|
+
|
|
14
|
+
### 用途与选型
|
|
15
|
+
|
|
16
|
+
用于包裹固定尺寸的内容区域,提供统一的自定义滚动条样式。
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 何时使用
|
|
20
|
+
|
|
21
|
+
- 页面局部区域需要独立滚动。
|
|
22
|
+
- 下拉面板、抽屉、表格等复合组件需要统一滚动条视觉。
|
|
23
|
+
- 需要通过方法控制内容区滚动位置。
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### 基础用法
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import 'x-next/style.css';
|
|
31
|
+
import { Scrollbar } from 'x-next';
|
|
32
|
+
|
|
33
|
+
</script>
|
|
34
|
+
<template>
|
|
35
|
+
<Scrollbar style="height: 160px">
|
|
36
|
+
<div style="height: 400px; box-sizing: border-box">
|
|
37
|
+
<p v-for="item in 12" :key="item">滚动内容 {{ item }}</p>
|
|
38
|
+
</div>
|
|
39
|
+
</Scrollbar>
|
|
40
|
+
</template>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 轨道类型
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import 'x-next/style.css';
|
|
48
|
+
import { Scrollbar } from 'x-next';
|
|
49
|
+
|
|
50
|
+
</script>
|
|
51
|
+
<template>
|
|
52
|
+
<Scrollbar type="track" style="height: 160px">
|
|
53
|
+
<div style="height: 400px; box-sizing: border-box">
|
|
54
|
+
<p v-for="item in 12" :key="item">带轨道滚动内容 {{ item }}</p>
|
|
55
|
+
</div>
|
|
56
|
+
</Scrollbar>
|
|
57
|
+
</template>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 横向滚动
|
|
61
|
+
|
|
62
|
+
默认横向滚动不会接管普通鼠标滚轮,可通过拖动滚动条、触控板横向手势或 Shift + 滚轮滚动。
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<script setup lang="ts">
|
|
66
|
+
import 'x-next/style.css';
|
|
67
|
+
import { Scrollbar } from 'x-next';
|
|
68
|
+
|
|
69
|
+
</script>
|
|
70
|
+
<template>
|
|
71
|
+
<Scrollbar style="width: 420px">
|
|
72
|
+
<div style="display: inline-flex; gap: 12px; width: max-content; min-width: 940px; padding: 12px; box-sizing: border-box">
|
|
73
|
+
<span v-for="item in 10" :key="item">阶段 {{ item }}</span>
|
|
74
|
+
</div>
|
|
75
|
+
</Scrollbar>
|
|
76
|
+
</template>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 鼠标滚轮横向滚动
|
|
80
|
+
|
|
81
|
+
设置 `horizontalWheel` 后,纯横向滚动区域会把普通鼠标滚轮转换为横向滚动;到达左右边界时会放行页面滚动。下面两个示例内容一致,可直接对比普通滚轮在未开启和开启后的差异。
|
|
82
|
+
|
|
83
|
+
```vue
|
|
84
|
+
<script setup lang="ts">
|
|
85
|
+
import 'x-next/style.css';
|
|
86
|
+
import { Scrollbar } from 'x-next';
|
|
87
|
+
|
|
88
|
+
</script>
|
|
89
|
+
<template>
|
|
90
|
+
<Scrollbar style="width: 420px">
|
|
91
|
+
<div style="display: inline-flex; gap: 12px; width: max-content; min-width: 940px; padding: 12px; box-sizing: border-box">
|
|
92
|
+
<span v-for="item in 10" :key="item">默认阶段 {{ item }}</span>
|
|
93
|
+
</div>
|
|
94
|
+
</Scrollbar>
|
|
95
|
+
|
|
96
|
+
<Scrollbar horizontal-wheel style="width: 420px">
|
|
97
|
+
<div style="display: inline-flex; gap: 12px; width: max-content; min-width: 940px; padding: 12px; box-sizing: border-box">
|
|
98
|
+
<span v-for="item in 10" :key="item">滚轮阶段 {{ item }}</span>
|
|
99
|
+
</div>
|
|
100
|
+
</Scrollbar>
|
|
101
|
+
</template>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 双向滚动
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import 'x-next/style.css';
|
|
109
|
+
import { Scrollbar } from 'x-next';
|
|
110
|
+
|
|
111
|
+
</script>
|
|
112
|
+
<template>
|
|
113
|
+
<Scrollbar type="track" style="width: 420px; height: 180px">
|
|
114
|
+
<div style="display: grid; grid-template-columns: repeat(8, 96px); gap: 8px; width: max-content; padding: 12px; box-sizing: border-box">
|
|
115
|
+
<span v-for="item in 80" :key="item">单元 {{ item }}</span>
|
|
116
|
+
</div>
|
|
117
|
+
</Scrollbar>
|
|
118
|
+
</template>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 滚动事件
|
|
122
|
+
|
|
123
|
+
```vue
|
|
124
|
+
<script setup lang="ts">
|
|
125
|
+
import 'x-next/style.css';
|
|
126
|
+
import { Scrollbar } from 'x-next';
|
|
127
|
+
import { ref } from 'vue';
|
|
128
|
+
|
|
129
|
+
const eventLog = ref('等待滚动');
|
|
130
|
+
|
|
131
|
+
const handleScroll = (event: Event) => {
|
|
132
|
+
const target = event.target as HTMLElement;
|
|
133
|
+
eventLog.value = `scrollTop: ${target.scrollTop}, scrollLeft: ${target.scrollLeft}`;
|
|
134
|
+
};
|
|
135
|
+
</script>
|
|
136
|
+
<template>
|
|
137
|
+
<Scrollbar style="height: 160px" @scroll="handleScroll">
|
|
138
|
+
<div style="height: 400px; box-sizing: border-box">
|
|
139
|
+
<p v-for="item in 12" :key="item">事件内容 {{ item }}</p>
|
|
140
|
+
</div>
|
|
141
|
+
</Scrollbar>
|
|
142
|
+
<p>{{ eventLog }}</p>
|
|
143
|
+
</template>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 命令式滚动
|
|
147
|
+
|
|
148
|
+
```vue
|
|
149
|
+
<script setup lang="ts">
|
|
150
|
+
import 'x-next/style.css';
|
|
151
|
+
import { Button, Scrollbar } from 'x-next';
|
|
152
|
+
import { ref } from 'vue';
|
|
153
|
+
|
|
154
|
+
const scrollbarRef = ref();
|
|
155
|
+
|
|
156
|
+
const scrollToTop = () => {
|
|
157
|
+
scrollbarRef.value?.scrollTo(0, 0);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const scrollToMiddle = () => {
|
|
161
|
+
scrollbarRef.value?.scrollTo({ top: 120, left: 180 });
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const scrollToBottom = () => {
|
|
165
|
+
scrollbarRef.value?.scrollTop(260);
|
|
166
|
+
};
|
|
167
|
+
</script>
|
|
168
|
+
<template>
|
|
169
|
+
<Button @click="scrollToTop">回到左上</Button>
|
|
170
|
+
<Button @click="scrollToMiddle">滚动到中部</Button>
|
|
171
|
+
<Button @click="scrollToBottom">滚动到底部</Button>
|
|
172
|
+
|
|
173
|
+
<Scrollbar ref="scrollbarRef" type="track" style="width: 420px; height: 180px">
|
|
174
|
+
<div style="display: grid; grid-template-columns: repeat(8, 96px); gap: 8px; width: max-content; padding: 12px; box-sizing: border-box">
|
|
175
|
+
<span v-for="item in 80" :key="item">单元 {{ item }}</span>
|
|
176
|
+
</div>
|
|
177
|
+
</Scrollbar>
|
|
178
|
+
</template>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 禁用滚动方向
|
|
182
|
+
|
|
183
|
+
```vue
|
|
184
|
+
<script setup lang="ts">
|
|
185
|
+
import 'x-next/style.css';
|
|
186
|
+
import { Scrollbar } from 'x-next';
|
|
187
|
+
|
|
188
|
+
</script>
|
|
189
|
+
<template>
|
|
190
|
+
<Scrollbar style="width: 420px" disable-horizontal>
|
|
191
|
+
<div style="display: inline-flex; gap: 12px; width: max-content; min-width: 940px; padding: 12px; box-sizing: border-box">
|
|
192
|
+
<span v-for="item in 10" :key="item">不会横向滚动 {{ item }}</span>
|
|
193
|
+
</div>
|
|
194
|
+
</Scrollbar>
|
|
195
|
+
</template>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 外层样式
|
|
199
|
+
|
|
200
|
+
`class` 和 `style` 会透传到内部滚动容器,同时 `style` 中的宽高、最大宽高等布局尺寸会同步到 Scrollbar 外层节点,保证自定义滚动条轨道和真实滚动区域对齐。横向或双向滚动场景建议直接在 Scrollbar 上设置 `width` / `height`。`outerClass` 和 `outerStyle` 用于控制 Scrollbar 外层节点。`hide` 是复合组件内部兼容选项,只隐藏自定义滚动条,不会禁用内容滚动,业务代码不建议直接使用。
|
|
201
|
+
|
|
202
|
+
```vue
|
|
203
|
+
<script setup lang="ts">
|
|
204
|
+
import 'x-next/style.css';
|
|
205
|
+
import { Scrollbar } from 'x-next';
|
|
206
|
+
|
|
207
|
+
</script>
|
|
208
|
+
<template>
|
|
209
|
+
<Scrollbar outer-class="scrollbar-shell" style="height: 160px">
|
|
210
|
+
<div style="height: 400px; box-sizing: border-box">
|
|
211
|
+
<p v-for="item in 12" :key="item">外层样式内容 {{ item }}</p>
|
|
212
|
+
</div>
|
|
213
|
+
</Scrollbar>
|
|
214
|
+
</template>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
返回 [AI 索引](../index.md)。先查本页与 [本地 API](./scrollbar-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
|