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.
Files changed (138) hide show
  1. package/AI_CODING.md +6 -5
  2. package/AI_USAGE/catalog.md +106 -105
  3. package/AI_USAGE/components/alert-api.md +48 -0
  4. package/AI_USAGE/components/alert.md +222 -3
  5. package/AI_USAGE/components/bar-chart-api.md +177 -0
  6. package/AI_USAGE/components/bar-chart.md +297 -3
  7. package/AI_USAGE/components/boxicons.md +147 -0
  8. package/AI_USAGE/components/button-api.md +144 -0
  9. package/AI_USAGE/components/button.md +447 -3
  10. package/AI_USAGE/components/charts.md +81 -0
  11. package/AI_USAGE/components/checkbox-api.md +145 -0
  12. package/AI_USAGE/components/checkbox.md +365 -3
  13. package/AI_USAGE/components/color-picker-api.md +52 -0
  14. package/AI_USAGE/components/color-picker.md +211 -3
  15. package/AI_USAGE/components/config-provider-api.md +38 -0
  16. package/AI_USAGE/components/config-provider.md +250 -3
  17. package/AI_USAGE/components/date-picker-api.md +1114 -0
  18. package/AI_USAGE/components/date-picker.md +378 -3
  19. package/AI_USAGE/components/dialog-api.md +142 -0
  20. package/AI_USAGE/components/dialog.md +284 -3
  21. package/AI_USAGE/components/draggable-api.md +146 -0
  22. package/AI_USAGE/components/draggable.md +259 -0
  23. package/AI_USAGE/components/drawer-api.md +78 -0
  24. package/AI_USAGE/components/drawer.md +227 -0
  25. package/AI_USAGE/components/dropdown-api.md +529 -0
  26. package/AI_USAGE/components/dropdown.md +392 -3
  27. package/AI_USAGE/components/empty-api.md +36 -0
  28. package/AI_USAGE/components/empty.md +227 -3
  29. package/AI_USAGE/components/finicon.md +88 -0
  30. package/AI_USAGE/components/form-api.md +524 -0
  31. package/AI_USAGE/components/form.md +454 -0
  32. package/AI_USAGE/components/grid-api.md +527 -0
  33. package/AI_USAGE/components/grid.md +224 -0
  34. package/AI_USAGE/components/heatmap-api.md +122 -0
  35. package/AI_USAGE/components/heatmap.md +220 -0
  36. package/AI_USAGE/components/icon-api.md +4707 -0
  37. package/AI_USAGE/components/icon.md +257 -0
  38. package/AI_USAGE/components/image-api.md +440 -0
  39. package/AI_USAGE/components/image.md +465 -0
  40. package/AI_USAGE/components/input-api.md +184 -0
  41. package/AI_USAGE/components/input-number-api.md +66 -0
  42. package/AI_USAGE/components/input-number.md +294 -0
  43. package/AI_USAGE/components/input-tag-api.md +114 -0
  44. package/AI_USAGE/components/input-tag.md +482 -0
  45. package/AI_USAGE/components/input.md +293 -3
  46. package/AI_USAGE/components/layout-api.md +147 -0
  47. package/AI_USAGE/components/layout.md +230 -0
  48. package/AI_USAGE/components/line-chart-api.md +197 -0
  49. package/AI_USAGE/components/line-chart.md +279 -3
  50. package/AI_USAGE/components/link-api.md +42 -0
  51. package/AI_USAGE/components/link.md +197 -0
  52. package/AI_USAGE/components/menu-api.md +516 -0
  53. package/AI_USAGE/components/menu.md +268 -0
  54. package/AI_USAGE/components/message-api.md +215 -0
  55. package/AI_USAGE/components/message-box-api.md +108 -0
  56. package/AI_USAGE/components/message-box.md +268 -3
  57. package/AI_USAGE/components/message.md +231 -3
  58. package/AI_USAGE/components/network-api.md +91 -0
  59. package/AI_USAGE/components/network.md +378 -0
  60. package/AI_USAGE/components/notification-api.md +236 -0
  61. package/AI_USAGE/components/notification.md +275 -3
  62. package/AI_USAGE/components/pagination-api.md +62 -0
  63. package/AI_USAGE/components/pagination.md +380 -3
  64. package/AI_USAGE/components/pie-chart-api.md +109 -0
  65. package/AI_USAGE/components/pie-chart.md +245 -3
  66. package/AI_USAGE/components/popconfirm-api.md +75 -0
  67. package/AI_USAGE/components/popconfirm.md +231 -3
  68. package/AI_USAGE/components/popover-api.md +75 -0
  69. package/AI_USAGE/components/popover.md +208 -3
  70. package/AI_USAGE/components/popup-api.md +75 -0
  71. package/AI_USAGE/components/popup.md +52 -0
  72. package/AI_USAGE/components/progress-api.md +44 -0
  73. package/AI_USAGE/components/progress.md +248 -3
  74. package/AI_USAGE/components/radio-api.md +165 -0
  75. package/AI_USAGE/components/radio.md +259 -3
  76. package/AI_USAGE/components/rate-api.md +54 -0
  77. package/AI_USAGE/components/rate.md +233 -3
  78. package/AI_USAGE/components/resize-box-api.md +56 -0
  79. package/AI_USAGE/components/resize-box.md +231 -0
  80. package/AI_USAGE/components/scrollbar-api.md +77 -0
  81. package/AI_USAGE/components/scrollbar.md +218 -0
  82. package/AI_USAGE/components/select-api.md +758 -0
  83. package/AI_USAGE/components/select.md +640 -3
  84. package/AI_USAGE/components/skeleton-api.md +85 -0
  85. package/AI_USAGE/components/skeleton.md +150 -0
  86. package/AI_USAGE/components/slider-api.md +51 -0
  87. package/AI_USAGE/components/slider.md +233 -3
  88. package/AI_USAGE/components/space-api.md +38 -0
  89. package/AI_USAGE/components/space.md +145 -0
  90. package/AI_USAGE/components/spin-api.md +43 -0
  91. package/AI_USAGE/components/spin.md +205 -0
  92. package/AI_USAGE/components/steps-api.md +111 -0
  93. package/AI_USAGE/components/steps.md +201 -3
  94. package/AI_USAGE/components/switch-api.md +58 -0
  95. package/AI_USAGE/components/switch.md +290 -3
  96. package/AI_USAGE/components/table-api.md +2919 -0
  97. package/AI_USAGE/components/table.md +1414 -0
  98. package/AI_USAGE/components/tabs-api.md +135 -0
  99. package/AI_USAGE/components/tabs.md +308 -3
  100. package/AI_USAGE/components/tag-api.md +124 -0
  101. package/AI_USAGE/components/tag.md +292 -0
  102. package/AI_USAGE/components/textarea-api.md +55 -0
  103. package/AI_USAGE/components/textarea.md +326 -3
  104. package/AI_USAGE/components/time-picker-api.md +137 -0
  105. package/AI_USAGE/components/time-picker.md +271 -3
  106. package/AI_USAGE/components/time-range-selector-api.md +44 -0
  107. package/AI_USAGE/components/time-range-selector.md +355 -0
  108. package/AI_USAGE/components/timeline-api.md +93 -0
  109. package/AI_USAGE/components/timeline.md +312 -0
  110. package/AI_USAGE/components/tooltip-api.md +77 -0
  111. package/AI_USAGE/components/tooltip.md +182 -0
  112. package/AI_USAGE/components/trend-chart-api.md +119 -0
  113. package/AI_USAGE/components/trend-chart.md +335 -0
  114. package/AI_USAGE/components/trigger-api.md +124 -0
  115. package/AI_USAGE/components/trigger.md +185 -0
  116. package/AI_USAGE/components/upload-api.md +200 -0
  117. package/AI_USAGE/components/upload.md +711 -3
  118. package/AI_USAGE/components/watermark-api.md +87 -0
  119. package/AI_USAGE/components/watermark.md +200 -0
  120. package/AI_USAGE/core.md +1 -1
  121. package/AI_USAGE/index.md +35 -7
  122. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  123. package/AI_USAGE.md +33651 -5
  124. package/CHANGELOG.md +18 -0
  125. package/dist/_utils/inherit-component-type.d.ts +11 -0
  126. package/dist/components/date-picker/index.d.ts +420 -5
  127. package/dist/components/form-input/index.d.ts +617 -2
  128. package/dist/components/layout/index.d.ts +689 -1
  129. package/dist/components/menu/index.d.ts +786 -1
  130. package/dist/es/_utils/inherit-component-type.js +6 -0
  131. package/dist/es/components/date-picker/index.js +18 -17
  132. package/dist/es/components/form-input/index.js +12 -11
  133. package/dist/es/components/layout/index.js +10 -9
  134. package/dist/es/components/menu/hooks/use-level.js +5 -5
  135. package/dist/es/components/menu/index.js +13 -10
  136. package/dist/index.cjs +3 -3
  137. package/dist/index.umd.js +3 -3
  138. package/package.json +10 -5
@@ -0,0 +1,465 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Image AI 使用
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 先读 [通用接入](../core.md)。公开导出:`Image, ImagePreview, ImagePreviewAction, ImagePreviewGroup`;主要模型:v-model:preview-visible。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./image-api.md),包含本组件族全部子组件和别名。
7
+
8
+ 按需样式:`x-next/style/image`(包含 base.css、image.css、trigger.css、tooltip.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
9
+
10
+ ## 场景用法
11
+
12
+ 以下示例从本地 `src/docs/components/image.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./image-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 { Image } from 'x-next';
32
+ const imageSrc =
33
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
34
+ </script>
35
+ <template>
36
+ <Image :src="imageSrc" width="160" height="120" fit="cover" alt="示例图片" />
37
+ </template>
38
+ ```
39
+
40
+ ### 适应方式
41
+
42
+ ```vue
43
+ <script setup lang="ts">
44
+ import 'x-next/style.css';
45
+ import { Image } from 'x-next';
46
+ const imageSrc =
47
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
48
+ </script>
49
+ <template>
50
+ <Image
51
+ :src="imageSrc"
52
+ width="120"
53
+ height="90"
54
+ fit="cover"
55
+ title="cover"
56
+ footer-position="outer"
57
+ />
58
+ <Image
59
+ :src="imageSrc"
60
+ width="120"
61
+ height="90"
62
+ fit="contain"
63
+ title="contain"
64
+ footer-position="outer"
65
+ />
66
+ <Image
67
+ :src="imageSrc"
68
+ width="120"
69
+ height="90"
70
+ fit="fill"
71
+ title="fill"
72
+ footer-position="outer"
73
+ />
74
+ </template>
75
+ ```
76
+
77
+ ### 底部信息
78
+
79
+ ```vue
80
+ <script setup lang="ts">
81
+ import 'x-next/style.css';
82
+ import { Image, Button } from 'x-next';
83
+ import { ref } from 'vue';
84
+
85
+ const footerActionCount = ref(0);
86
+ const imageSrc =
87
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
88
+ </script>
89
+ <template>
90
+ <Image
91
+ :src="imageSrc"
92
+ width="180"
93
+ height="120"
94
+ title="组件封面"
95
+ description="底部信息覆盖在图片内部"
96
+ fit="cover"
97
+ />
98
+ <Image
99
+ :src="imageSrc"
100
+ width="180"
101
+ height="120"
102
+ title="外置说明"
103
+ description="footerPosition 设置为 outer"
104
+ footer-position="outer"
105
+ fit="cover"
106
+ />
107
+ <Image :src="imageSrc" width="240" height="140" title="底部操作" fit="cover">
108
+ <template #extra>
109
+ <Button size="mini" @click="footerActionCount++">收藏 {{ footerActionCount }}</Button>
110
+ </template>
111
+ </Image>
112
+ </template>
113
+ ```
114
+
115
+ ### 加载和错误
116
+
117
+ 失败占位使用中性色背景,并保留图片圆角。可通过 `error` / `error-icon` 自定义内容;修改 `src` 后会重新进入加载流程,支持从失败地址恢复。
118
+
119
+ ```vue
120
+ <script setup lang="ts">
121
+ import 'x-next/style.css';
122
+ import { Image } from 'x-next';
123
+ const imageSrc =
124
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
125
+ </script>
126
+ <template>
127
+ <Image :src="imageSrc" width="160" height="110" show-loader fit="cover" />
128
+ <Image src="data:image/png;base64,broken-image" width="160" height="110" alt="图片加载失败" />
129
+ <Image src="data:image/png;base64,broken-image" width="160" height="110">
130
+ <template #error-icon><span aria-hidden="true">◇</span></template>
131
+ </Image>
132
+ <Image src="data:image/png;base64,broken-image" width="160" height="110">
133
+ <template #error>
134
+ <div class="image-error">无法加载图片</div>
135
+ </template>
136
+ </Image>
137
+ </template>
138
+ <style scoped>
139
+ .image-error {
140
+ display: flex;
141
+ align-items: center;
142
+ justify-content: center;
143
+ width: 100%;
144
+ height: 100%;
145
+ color: var(--x-color-text-secondary);
146
+ background: var(--x-color-fill-2);
147
+ }
148
+ </style>
149
+ ```
150
+
151
+ ### 更换图片与错误恢复
152
+
153
+ 直接更新 `src`。组件会重置加载状态和旧图片节点;加载失败后可通过插槽中的按钮改回有效地址。下面的图片均是离线可用的低饱和风景插画,加载通常很快。
154
+
155
+ ```vue
156
+ <script setup lang="ts">
157
+ import 'x-next/style.css';
158
+ import { Button, Image } from 'x-next';
159
+ import { ref } from 'vue';
160
+ const landscape = (sky: string, hills: string) =>
161
+ 'data:image/svg+xml,' +
162
+ encodeURIComponent(
163
+ `<svg xmlns="http://www.w3.org/2000/svg" width="480" height="300"><rect width="480" height="300" fill="${sky}"/><path d="M0 230Q120 110 240 220T480 180V300H0Z" fill="${hills}"/></svg>`,
164
+ );
165
+ const landscapes = [landscape('#e8efec', '#a6bdb1'), landscape('#f0ebe4', '#bca996')];
166
+ const src = ref(landscapes[0]);
167
+ const state = ref('图片已选择');
168
+ </script>
169
+ <template>
170
+ <Button @click="src = landscapes[0]">湖畔</Button>
171
+ <Button @click="src = landscapes[1]">山丘</Button>
172
+ <Button @click="src = 'data:image/png;base64,broken-image'">模拟失败</Button>
173
+ <Image
174
+ :src="src"
175
+ width="240"
176
+ height="150"
177
+ fit="cover"
178
+ show-loader
179
+ alt="可替换风景"
180
+ @load="state = '图片已加载'"
181
+ @error="state = '加载失败'"
182
+ >
183
+ <template #loader><div class="placeholder">正在准备图片…</div></template>
184
+ <template #error>
185
+ <div class="placeholder">
186
+ <span>图片暂时无法加载</span>
187
+ <Button size="mini" @click="src = landscapes[0]">恢复图片</Button>
188
+ </div>
189
+ </template>
190
+ </Image>
191
+ <span aria-live="polite">{{ state }}</span>
192
+ </template>
193
+ <style scoped>
194
+ .placeholder {
195
+ display: flex;
196
+ flex-direction: column;
197
+ align-items: center;
198
+ justify-content: center;
199
+ gap: 12px;
200
+ width: 100%;
201
+ height: 100%;
202
+ color: var(--x-color-text-secondary);
203
+ background: var(--x-color-fill-2);
204
+ }
205
+ </style>
206
+ ```
207
+
208
+ ### 受控预览
209
+
210
+ ```vue
211
+ <script setup lang="ts">
212
+ import 'x-next/style.css';
213
+ import { Button, Image } from 'x-next';
214
+ import { ref } from 'vue';
215
+
216
+ const imageSrc =
217
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
218
+ const previewVisible = ref(false);
219
+ const logs = ref<string[]>([]);
220
+ const onPreviewVisibleChange = (visible: boolean) => {
221
+ logs.value = [visible ? '已打开' : '已关闭', ...logs.value].slice(0, 4);
222
+ };
223
+ </script>
224
+ <template>
225
+ <Button @click="previewVisible = true">打开预览</Button>
226
+ <Image
227
+ v-model:preview-visible="previewVisible"
228
+ :src="imageSrc"
229
+ width="180"
230
+ height="120"
231
+ fit="cover"
232
+ @preview-visible-change="onPreviewVisibleChange"
233
+ />
234
+ <p>当前:{{ previewVisible ? '已打开' : '已关闭' }}</p>
235
+ <p v-for="(log, index) in logs" :key="index">{{ log }}</p>
236
+ </template>
237
+ ```
238
+
239
+ ### 预览组
240
+
241
+ 设置 `srcList` 时,预览内容以该列表为准,子图片作为打开对应下标的缩略图;缩略图与列表应保持相同顺序,也可以使用不同的缩略图与高清图片地址。不传 `srcList` 时,预览组自动收集子图片。
242
+
243
+ ```vue
244
+ <script setup lang="ts">
245
+ import 'x-next/style.css';
246
+ import { ImagePreviewGroup, Image } from 'x-next';
247
+ import { ref } from 'vue';
248
+
249
+ const visible = ref(false);
250
+ const current = ref(0);
251
+ const images = [
252
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E',
253
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23f0ebe4%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23fcf5e6%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23d7cbbd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23bca996%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%23998571%22%2F%3E%3C%2Fsvg%3E',
254
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e9edf2%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23f7f5ef%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c7d1df%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a7b7ca%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%238098b2%22%2F%3E%3C%2Fsvg%3E',
255
+ ];
256
+ const onChange = (index: number) => {
257
+ console.log('current image:', index);
258
+ };
259
+ </script>
260
+ <template>
261
+ <ImagePreviewGroup
262
+ v-model:visible="visible"
263
+ v-model:current="current"
264
+ :src-list="images"
265
+ infinite
266
+ @change="onChange"
267
+ >
268
+ <Image
269
+ v-for="(item, index) in images"
270
+ :key="item"
271
+ :src="item"
272
+ width="120"
273
+ height="84"
274
+ fit="cover"
275
+ :title="`风景 ${index + 1}`"
276
+ footer-position="outer"
277
+ />
278
+ </ImagePreviewGroup>
279
+ <p>当前图片:{{ current + 1 }} / {{ images.length }}</p>
280
+ </template>
281
+ ```
282
+
283
+ ### 自定义预览操作
284
+
285
+ ```vue
286
+ <script setup lang="ts">
287
+ import 'x-next/style.css';
288
+ import { Image, ImagePreviewAction } from 'x-next';
289
+ import { ref } from 'vue';
290
+
291
+ const imageSrc =
292
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
293
+ const logs = ref<string[]>([]);
294
+ const record = () => {
295
+ logs.value = ['点击了自定义预览操作', ...logs.value].slice(0, 4);
296
+ };
297
+ </script>
298
+ <template>
299
+ <Image :src="imageSrc" width="180" height="120" fit="cover">
300
+ <template #preview-actions>
301
+ <ImagePreviewAction name="记录" @click="record">
302
+ <span>记</span>
303
+ </ImagePreviewAction>
304
+ </template>
305
+ </Image>
306
+ <p v-for="(log, index) in logs" :key="index">{{ log }}</p>
307
+ </template>
308
+ ```
309
+
310
+ ### 关闭缩略图预览
311
+
312
+ `preview=false` 时点击缩略图不会打开预览;在自动收集的预览组中,方向键和箭头切换会跳过该图片。
313
+
314
+ ```vue
315
+ <script setup lang="ts">
316
+ import 'x-next/style.css';
317
+ import { Image } from 'x-next';
318
+ const imageSrc =
319
+ 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22300%22%20viewBox%3D%220%200%20480%20300%22%3E%3Crect%20width%3D%22480%22%20height%3D%22300%22%20fill%3D%22%23e8efec%22%2F%3E%3Ccircle%20cx%3D%22356%22%20cy%3D%2276%22%20r%3D%2230%22%20fill%3D%22%23faf6e9%22%2F%3E%3Cpath%20d%3D%22M0%20186Q94%2098%20196%20174T480%20150V300H0Z%22%20fill%3D%22%23c8d6cd%22%2F%3E%3Cpath%20d%3D%22M0%20216Q120%20160%20230%20202T480%20190V300H0Z%22%20fill%3D%22%23a6bdb1%22%2F%3E%3Cpath%20d%3D%22M0%20264Q124%20210%20260%20250T480%20242V300H0Z%22%20fill%3D%22%237f9e90%22%2F%3E%3C%2Fsvg%3E';
320
+ </script>
321
+ <template>
322
+ <Image
323
+ :src="imageSrc"
324
+ width="180"
325
+ height="120"
326
+ fit="cover"
327
+ :preview="false"
328
+ title="仅展示图片"
329
+ />
330
+ </template>
331
+ ```
332
+
333
+ ### 动态图片列表
334
+
335
+ 不传 `srcList` 时,修改子图片地址会更新当前预览,并保留注册顺序;移除图片后下标会调整,清空列表会关闭预览。使用稳定的 `key` 标识每张图片。
336
+
337
+ ```vue
338
+ <script setup lang="ts">
339
+ import 'x-next/style.css';
340
+ import { Button, ImagePreviewGroup, Image } from 'x-next';
341
+ import { ref } from 'vue';
342
+
343
+ const makeImage = (color: string) =>
344
+ 'data:image/svg+xml,' +
345
+ encodeURIComponent(
346
+ `<svg xmlns="http://www.w3.org/2000/svg" width="320" height="200"><rect width="320" height="200" fill="${color}"/></svg>`,
347
+ );
348
+ const createImages = () =>
349
+ ['#a6bdb1', '#bca996', '#a7b7ca'].map((color, index) => ({
350
+ id: index + 1,
351
+ src: makeImage(color),
352
+ }));
353
+ const images = ref(createImages());
354
+ const visible = ref(false);
355
+ const current = ref(0);
356
+ const replaceFirst = () => {
357
+ if (images.value[0]) images.value[0].src = makeImage('#b8c9ba');
358
+ };
359
+ const restore = () => {
360
+ visible.value = false;
361
+ current.value = 0;
362
+ images.value = createImages();
363
+ };
364
+ </script>
365
+ <template>
366
+ <Button :disabled="!images.length" @click="replaceFirst">替换第一张</Button>
367
+ <Button :disabled="!images.length" @click="images.shift()">移除第一张</Button>
368
+ <Button @click="images = []">清空图片</Button>
369
+ <Button @click="restore">恢复图片</Button>
370
+ <ImagePreviewGroup v-model:visible="visible" v-model:current="current">
371
+ <Image
372
+ v-for="item in images"
373
+ :key="item.id"
374
+ :src="item.src"
375
+ width="120"
376
+ height="84"
377
+ fit="cover"
378
+ :title="`风景 ${item.id}`"
379
+ footer-position="outer"
380
+ />
381
+ </ImagePreviewGroup>
382
+ <p>{{ images.length ? `当前图片:${current + 1} / ${images.length}` : '图片列表为空' }}</p>
383
+ </template>
384
+ ```
385
+
386
+ ### 独立预览与自定义工具条
387
+
388
+ 预览工具条使用深色半透明背景,亮暗主题保持一致。将 `actionsLayout` 设为空数组可仅保留自定义操作;关闭后焦点返回打开预览的按钮。
389
+
390
+ ```vue
391
+ <script setup lang="ts">
392
+ import 'x-next/style.css';
393
+ import { Button, ImagePreview, ImagePreviewAction } from 'x-next';
394
+ import { ref } from 'vue';
395
+ const visible = ref(false);
396
+ const count = ref(0);
397
+ const src =
398
+ 'data:image/svg+xml,' +
399
+ encodeURIComponent(
400
+ '<svg xmlns="http://www.w3.org/2000/svg" width="480" height="300"><rect width="480" height="300" fill="#c8d6cd"/></svg>',
401
+ );
402
+ </script>
403
+ <template>
404
+ <Button @click="visible = true">打开独立预览</Button>
405
+ <span>已记录 {{ count }} 次</span>
406
+ <ImagePreview v-model:visible="visible" :src="src" :actions-layout="[]">
407
+ <template #actions>
408
+ <ImagePreviewAction name="记录" @click="count++"><span>记</span></ImagePreviewAction>
409
+ </template>
410
+ </ImagePreview>
411
+ </template>
412
+ ```
413
+
414
+ ### 容器内预览
415
+
416
+ 通过 `popupContainer` 指定宿主,可将预览限制在局部容器内;设置宽高并保留定位上下文。`defaultScale` 会限制在 0.25~5 倍,滚轮速率需大于 1,非法值会使用默认值。
417
+
418
+ ```vue
419
+ <script setup lang="ts">
420
+ import 'x-next/style.css';
421
+ import { Button, ImagePreview } from 'x-next';
422
+ import { ref } from 'vue';
423
+ const host = ref<HTMLElement>();
424
+ const visible = ref(false);
425
+ const src =
426
+ 'data:image/svg+xml,' +
427
+ encodeURIComponent(
428
+ '<svg xmlns="http://www.w3.org/2000/svg" width="480" height="300"><rect width="480" height="300" fill="#a7b7ca"/></svg>',
429
+ );
430
+ </script>
431
+ <template>
432
+ <Button @click="visible = true">在容器内预览</Button>
433
+ <div ref="host" class="preview-host">
434
+ <ImagePreview
435
+ v-model:visible="visible"
436
+ :src="src"
437
+ :popup-container="host"
438
+ :default-scale="0.75"
439
+ />
440
+ </div>
441
+ </template>
442
+ <style scoped>
443
+ .preview-host {
444
+ position: relative;
445
+ width: 100%;
446
+ height: 300px;
447
+ overflow: hidden;
448
+ }
449
+ </style>
450
+ ```
451
+
452
+ ### 交互说明
453
+
454
+ - 预览打开后支持鼠标拖拽图片、滚轮缩放图片。
455
+ - 图片加载成功后可聚焦缩略图,通过 Enter / Space 打开预览;加载中、错误或 `preview=false` 时不会打开。
456
+ - Tab 在预览内循环,关闭或卸载时恢复打开前的焦点;快捷键仅作用于最上层弹层。
457
+ - 工具条默认深色半透明,悬浮和焦点使用浅色透明高亮。可覆盖 `--x-image-preview-color-toolbar-bg` 等 token 定制。
458
+ - 满屏按容器较小轴缩放以保留完整图片,并遵守 0.25~5 倍范围。预览失败显示明确反馈,组内可继续切换下一张。
459
+ - `keyboard` 为 `true` 时,Esc 关闭预览,左右方向键切换预览组,上下方向键缩放,Space 还原到原始大小。
460
+ - 使用受控的 `current` / `visible` 时,请接收对应更新事件或使用 `v-model`;列表为空时预览不会显示。
461
+ - `srcList` 初始下标超界时会发送 `update:current` 请求修正,受控模式等待父组件更新下标后显示有效图片。
462
+
463
+
464
+
465
+ 返回 [AI 索引](../index.md)。先查本页与 [本地 API](./image-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
@@ -0,0 +1,184 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Input 完整公开 API
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
7
+
8
+ ## Input API
9
+
10
+ 公开声明:`dist/components/form-input/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
11
+
12
+ ### Props
13
+
14
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
15
+ | --- | --- | --- | --- | --- |
16
+ | modelValue | 绑定值 | undefined &#124; string | 否 | 未声明 |
17
+ | defaultValue | 默认值,非受控模式 | undefined &#124; string | 否 | "" |
18
+ | size | 输入框尺寸 | undefined &#124; "mini" &#124; "small" &#124; "medium" &#124; "large" | 否 | 未声明 |
19
+ | allowClear | 是否允许清空 | undefined &#124; false &#124; true | 否 | false |
20
+ | disabled | 是否禁用 | undefined &#124; false &#124; true | 否 | false |
21
+ | readonly | 是否只读 | undefined &#124; false &#124; true | 否 | false |
22
+ | error | 是否为错误状态 | undefined &#124; false &#124; true | 否 | false |
23
+ | placeholder | 占位提示 | undefined &#124; string | 否 | 未声明 |
24
+ | maxLength | 最大长度,支持仅提示错误 | undefined &#124; number &#124; { length: number; errorOnly?: boolean; } | 否 | 0 |
25
+ | showWordLimit | 是否显示字数统计 | undefined &#124; false &#124; true | 否 | false |
26
+ | wordLength | 字符长度计算方法 | undefined &#124; (value: string) => number | 否 | 未声明 |
27
+ | wordSlice | 超长时的截取方法 | undefined &#124; (value: string, maxLength: number) => string | 否 | 未声明 |
28
+ | inputAttrs | 内部 input 元素属性 | undefined &#124; { [x: string]: any; } | 否 | 未声明 |
29
+ | type | 见场景用法与类型 | undefined &#124; "text" &#124; "password" | 否 | "text" |
30
+
31
+ ### Events
32
+
33
+ | 事件 | 用途 | 监听器签名(即事件参数) |
34
+ | --- | --- | --- |
35
+ | update:modelValue | 值更新时触发 | undefined &#124; (value: string) => any |
36
+ | input | 用户输入时触发 | undefined &#124; (value: string, ev: Event) => any |
37
+ | change | 失焦或按下回车且值变化时触发 | undefined &#124; (value: string, ev: Event) => any |
38
+ | pressEnter | 按下回车时触发 | undefined &#124; (ev: KeyboardEvent) => any |
39
+ | clear | 点击清除按钮时触发 | undefined &#124; (ev: MouseEvent) => any |
40
+ | focus | 获取焦点时触发 | undefined &#124; (ev: FocusEvent) => any |
41
+ | blur | 失去焦点时触发 | undefined &#124; (ev: FocusEvent) => any |
42
+
43
+ ### Slots
44
+
45
+ | 名称 | 用途 | 公开类型 |
46
+ | --- | --- | --- |
47
+ | prefix | 前缀内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
48
+ | suffix | 后缀内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
49
+ | prepend | 前置标签 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
50
+ | append | 后置标签 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
51
+
52
+ ### 实例方法 / 暴露值
53
+
54
+ | 名称 | 公开类型 |
55
+ | --- | --- |
56
+ | focus | () => void |
57
+ | blur | () => void |
58
+
59
+
60
+ ## InputGroup API
61
+
62
+ 公开声明:`dist/components/form-input/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
63
+
64
+ ### Props
65
+
66
+ 未声明自身 props;包装透传能力见本页用法。
67
+
68
+ ### Events
69
+
70
+ 未声明组件 emits;原生事件与包装透传按本页用法核实。
71
+
72
+ ### Slots
73
+
74
+ 公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
75
+
76
+ ### 实例方法
77
+
78
+ 没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
79
+
80
+
81
+ ## InputPassword API
82
+
83
+ 公开声明:`dist/components/form-input/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
84
+
85
+ ### Props
86
+
87
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
88
+ | --- | --- | --- | --- | --- |
89
+ | disabled | 禁用输入和显隐按钮,继承 Form | undefined &#124; false &#124; true | 否 | false |
90
+ | visibility | 密码是否以明文显示,受控属性 | undefined &#124; false &#124; true | 否 | undefined |
91
+ | defaultVisibility | 非受控模式下默认是否显示明文 | undefined &#124; false &#124; true | 否 | true |
92
+ | invisibleButton | 是否显示密码显隐按钮 | undefined &#124; false &#124; true | 否 | true |
93
+ | modelValue | 见场景用法与类型 | undefined &#124; string | 否 | 透传内层组件;默认值见对应组件 |
94
+ | error | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
95
+ | size | 见场景用法与类型 | undefined &#124; "mini" &#124; "small" &#124; "medium" &#124; "large" | 否 | 透传内层组件;默认值见对应组件 |
96
+ | defaultValue | 见场景用法与类型 | undefined &#124; string | 否 | 透传内层组件;默认值见对应组件 |
97
+ | placeholder | 见场景用法与类型 | undefined &#124; string | 否 | 透传内层组件;默认值见对应组件 |
98
+ | readonly | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
99
+ | allowClear | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
100
+ | inputAttrs | 见场景用法与类型 | undefined &#124; { [x: string]: any; } | 否 | 透传内层组件;默认值见对应组件 |
101
+ | maxLength | 见场景用法与类型 | undefined &#124; number &#124; { length: number; errorOnly?: boolean; } | 否 | 透传内层组件;默认值见对应组件 |
102
+ | showWordLimit | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
103
+ | wordLength | 见场景用法与类型 | undefined &#124; (value: string) => number | 否 | 透传内层组件;默认值见对应组件 |
104
+ | wordSlice | 见场景用法与类型 | undefined &#124; (value: string, maxLength: number) => string | 否 | 透传内层组件;默认值见对应组件 |
105
+
106
+ ### Events
107
+
108
+ | 事件 | 用途 | 监听器签名(即事件参数) |
109
+ | --- | --- | --- |
110
+ | visibility-change | 见场景用法与类型 | undefined &#124; ((...args: any[]) => any) & ((...args: any[]) => any) |
111
+ | update:visibility | 用于 v-model:visibility 同步 | undefined &#124; ((...args: any[]) => any) & ((...args: any[]) => any) |
112
+ | update:modelValue | 见场景用法与类型 | undefined &#124; (value: string) => any |
113
+ | focus | 见场景用法与类型 | undefined &#124; (ev: FocusEvent) => any |
114
+ | clear | 见场景用法与类型 | undefined &#124; (ev: MouseEvent) => any |
115
+ | blur | 见场景用法与类型 | undefined &#124; (ev: FocusEvent) => any |
116
+ | change | 见场景用法与类型 | undefined &#124; (value: string, ev: Event) => any |
117
+ | input | 见场景用法与类型 | undefined &#124; (value: string, ev: Event) => any |
118
+ | pressEnter | 见场景用法与类型 | undefined &#124; (ev: KeyboardEvent) => any |
119
+
120
+ ### Slots
121
+
122
+ 公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
123
+
124
+ ### 实例方法 / 暴露值
125
+
126
+ | 名称 | 公开类型 |
127
+ | --- | --- |
128
+ | focus | (() => void) & (() => void) |
129
+ | blur | (() => void) & (() => void) |
130
+
131
+
132
+ ## InputSearch API
133
+
134
+ 公开声明:`dist/components/form-input/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
135
+
136
+ ### Props
137
+
138
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
139
+ | --- | --- | --- | --- | --- |
140
+ | searchButton | 使用后置搜索按钮 | undefined &#124; false &#124; true | 否 | false |
141
+ | loading | 搜索加载状态 | undefined &#124; false &#124; true | 否 | false |
142
+ | disabled | 禁用输入和搜索按钮 | undefined &#124; false &#124; true | 否 | false |
143
+ | size | 尺寸,继承 Form / 全局配置 | undefined &#124; "mini" &#124; "small" &#124; "medium" &#124; "large" | 否 | 未声明 |
144
+ | buttonText | 搜索按钮文字 | undefined &#124; string | 否 | 未声明 |
145
+ | buttonProps | 搜索按钮属性 | undefined &#124; { disabled?: boolean; block?: boolean; loading?: boolean; loadingFill?: boolean; debounce?: number; shape?: ButtonShape; link?: boolean; type?: ButtonTypes; htmlType?: ButtonHtmlType; status?: ButtonStatus; plain?: boolean; size?: ButtonSize; border?: boolean; narrow?: boolean; } | 否 | 未声明 |
146
+ | modelValue | 见场景用法与类型 | undefined &#124; string | 否 | 透传内层组件;默认值见对应组件 |
147
+ | type | 见场景用法与类型 | undefined &#124; "text" &#124; "password" | 否 | 透传内层组件;默认值见对应组件 |
148
+ | error | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
149
+ | defaultValue | 见场景用法与类型 | undefined &#124; string | 否 | 透传内层组件;默认值见对应组件 |
150
+ | placeholder | 见场景用法与类型 | undefined &#124; string | 否 | 透传内层组件;默认值见对应组件 |
151
+ | readonly | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
152
+ | allowClear | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
153
+ | inputAttrs | 见场景用法与类型 | undefined &#124; { [x: string]: any; } | 否 | 透传内层组件;默认值见对应组件 |
154
+ | maxLength | 见场景用法与类型 | undefined &#124; number &#124; { length: number; errorOnly?: boolean; } | 否 | 透传内层组件;默认值见对应组件 |
155
+ | showWordLimit | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | 透传内层组件;默认值见对应组件 |
156
+ | wordLength | 见场景用法与类型 | undefined &#124; (value: string) => number | 否 | 透传内层组件;默认值见对应组件 |
157
+ | wordSlice | 见场景用法与类型 | undefined &#124; (value: string, maxLength: number) => string | 否 | 透传内层组件;默认值见对应组件 |
158
+
159
+ ### Events
160
+
161
+ | 事件 | 用途 | 监听器签名(即事件参数) |
162
+ | --- | --- | --- |
163
+ | search | 点击可用搜索按钮时触发 | undefined &#124; ((value: string, ev: MouseEvent) => any) & ((value: string, ev: MouseEvent) => any) |
164
+ | update:modelValue | 见场景用法与类型 | undefined &#124; (value: string) => any |
165
+ | focus | 见场景用法与类型 | undefined &#124; (ev: FocusEvent) => any |
166
+ | clear | 见场景用法与类型 | undefined &#124; (ev: MouseEvent) => any |
167
+ | blur | 见场景用法与类型 | undefined &#124; (ev: FocusEvent) => any |
168
+ | change | 见场景用法与类型 | undefined &#124; (value: string, ev: Event) => any |
169
+ | input | 见场景用法与类型 | undefined &#124; (value: string, ev: Event) => any |
170
+ | pressEnter | 见场景用法与类型 | undefined &#124; (ev: KeyboardEvent) => any |
171
+
172
+ ### Slots
173
+
174
+ 公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
175
+
176
+ ### 实例方法 / 暴露值
177
+
178
+ | 名称 | 公开类型 |
179
+ | --- | --- |
180
+ | focus | (() => void) & (() => void) |
181
+ | blur | (() => void) & (() => void) |
182
+
183
+
184
+ 返回 [Input 用法](./input.md)。