x-next 1.12.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 (226) 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 +386 -5
  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 +33657 -7
  124. package/CHANGELOG.md +40 -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/components/network/Network.vue.d.ts +7 -3
  131. package/dist/components/network/index.d.ts +10 -2
  132. package/dist/components/network/props.d.ts +5 -0
  133. package/dist/components/network/utils.d.ts +3 -3
  134. package/dist/components/pagination/page-item-ellipsis.vue.d.ts +4 -1
  135. package/dist/components/pagination/page-item-step.vue.d.ts +101 -130
  136. package/dist/components/pagination/page-item.vue.d.ts +1 -0
  137. package/dist/components/pagination/page-jumper.vue.d.ts +1 -1
  138. package/dist/components/pagination/page-options.vue.d.ts +6 -4
  139. package/dist/components/pagination/utils.d.ts +3 -0
  140. package/dist/components/time-range-selector/index.d.ts +6 -6
  141. package/dist/es/_container/resize-observer-v2.js +1 -1
  142. package/dist/es/_container/resize-observer.js +1 -1
  143. package/dist/es/_hooks/use-resize-observer.js +1 -1
  144. package/dist/es/_styles/palette-aliases.js +4 -4
  145. package/dist/es/_utils/inherit-component-type.js +6 -0
  146. package/dist/es/_virtual/advancedFormat.js +1 -1
  147. package/dist/es/_virtual/customParseFormat.js +1 -1
  148. package/dist/es/_virtual/dayjs.min.js +1 -1
  149. package/dist/es/_virtual/isBetween.js +1 -1
  150. package/dist/es/_virtual/quarterOfYear.js +1 -1
  151. package/dist/es/_virtual/weekOfYear.js +1 -1
  152. package/dist/es/_virtual/weekYear.js +1 -1
  153. package/dist/es/_virtual/zh-cn.js +1 -1
  154. package/dist/es/components/button/Button.js +53 -42
  155. package/dist/es/components/date-picker/index.js +18 -17
  156. package/dist/es/components/draggable/useDraggable.js +1 -1
  157. package/dist/es/components/form/Form.vue2.js +1 -1
  158. package/dist/es/components/form/FormItem.vue2.js +1 -1
  159. package/dist/es/components/form-input/index.js +12 -11
  160. package/dist/es/components/form-input-number/InputNumber.js +1 -1
  161. package/dist/es/components/form-slider/Slider.vue2.js +1 -1
  162. package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
  163. package/dist/es/components/form-slider/utils.js +1 -1
  164. package/dist/es/components/layout/index.js +10 -9
  165. package/dist/es/components/menu/MenuItem.js +1 -1
  166. package/dist/es/components/menu/hooks/use-level.js +5 -5
  167. package/dist/es/components/menu/index.js +13 -10
  168. package/dist/es/components/menu/overflow-wrap.js +1 -1
  169. package/dist/es/components/network/Network.vue.js +17 -12
  170. package/dist/es/components/network/Network.vue2.js +78 -70
  171. package/dist/es/components/network/utils.js +112 -71
  172. package/dist/es/components/pagination/Pagination.js +132 -123
  173. package/dist/es/components/pagination/page-item-ellipsis.vue.js +10 -10
  174. package/dist/es/components/pagination/page-item-ellipsis.vue2.js +24 -19
  175. package/dist/es/components/pagination/page-item-step.vue.js +14 -11
  176. package/dist/es/components/pagination/page-item-step.vue2.js +20 -22
  177. package/dist/es/components/pagination/page-item.vue.js +10 -9
  178. package/dist/es/components/pagination/page-item.vue2.js +24 -19
  179. package/dist/es/components/pagination/page-jumper.vue2.js +23 -23
  180. package/dist/es/components/pagination/page-options.vue.js +15 -10
  181. package/dist/es/components/pagination/page-options.vue2.js +21 -17
  182. package/dist/es/components/pagination/utils.js +4 -2
  183. package/dist/es/components/progress/circle.vue2.js +1 -1
  184. package/dist/es/components/progress/line.vue2.js +1 -1
  185. package/dist/es/components/progress/steps.vue2.js +1 -1
  186. package/dist/es/components/rate/Rate.js +1 -1
  187. package/dist/es/components/virtual-list-v2/virtual-list-item.js +1 -1
  188. package/dist/es/locale/en-US.js +2 -0
  189. package/dist/es/locale/zh-CN.js +2 -0
  190. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
  191. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/locale/zh-cn.js +1 -1
  192. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/advancedFormat.js +1 -1
  193. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js +1 -1
  194. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js +1 -1
  195. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/quarterOfYear.js +1 -1
  196. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekOfYear.js +1 -1
  197. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekYear.js +1 -1
  198. package/dist/es/style.css +1 -1
  199. package/dist/index.cjs +3 -3
  200. package/dist/index.umd.js +3 -3
  201. package/dist/locale/interface.d.ts +3 -0
  202. package/dist/style/base.css +1 -1
  203. package/dist/style/button.css +1 -1
  204. package/dist/style/form-select.css +1 -1
  205. package/dist/style/network.css +1 -1
  206. package/dist/style/pagination.css +1 -1
  207. package/dist/style/table.css +1 -1
  208. package/dist/style.css +1 -1
  209. package/package.json +10 -5
  210. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js +0 -0
  211. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/is.js +0 -0
  212. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/locale/en-US.js +0 -0
  213. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/array.js +0 -0
  214. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/base.js +0 -0
  215. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/boolean.js +0 -0
  216. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/custom.js +0 -0
  217. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/number.js +0 -0
  218. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/object.js +0 -0
  219. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/string.js +0 -0
  220. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/type.js +0 -0
  221. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/util.js +0 -0
  222. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js +0 -0
  223. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js +0 -0
  224. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -0
  225. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js +0 -0
  226. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +0 -0
@@ -1,12 +1,14 @@
1
1
  <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
2
  # Popover AI 使用
3
3
 
4
- 适用版本:x-next@1.12.0;来源指纹:`9f9adf42b42dc1e551f500aabdcb7fb07b69a93ea44ff3dc1d16dab1a4c85843`。
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
5
 
6
- 先读 [通用接入](../core.md)。公开导出:`Popover`;模型:v-model:popup-visible;已核对事件:popupVisibleChange。
6
+ 先读 [通用接入](../core.md)。公开导出:`Popover`;主要模型:v-model:popup-visible。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./popover-api.md),包含本组件族全部子组件和别名。
7
7
 
8
8
  按需样式:`x-next/style/popover`(包含 base.css、popover.css、trigger.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
9
9
 
10
+ ## 已核验行为与示例
11
+
10
12
  [组件文档与 live demo](https://x-next.yjmf.com/components/popover)。使用 `v-model:popup-visible`;默认 `trigger='click'`、`position='bottom'`、`showArrow=false`、`defaultPopupVisible=false`、`unmountOnClose=true`。默认插槽是触发器,`title` / `content` 插槽放浮层内容。
11
13
 
12
14
  `popup-visible-change(visible)` 返回布尔值,`show` / `hide` 无参数。点击触发器或外部默认可以关闭;`popupContainer` 和 `renderToBody` 决定宿主,用于定位、滚动及裁剪。通过 ConfigProvider 配置的主题会由 Trigger 同步到浮层根,默认挂到 body 也生效;任意业务 CSS 变量或仅在局部 DOM 调用 applyThemeColor 不等于该注入协议,仍要核对实际继承。
@@ -32,4 +34,207 @@ function changed(value: boolean) { feedback.value = value ? '说明已打开' :
32
34
  </template>
33
35
  ```
34
36
 
35
- 返回 [AI 索引](../index.md)。精选示例不是完整 API 表,新能力先查同版本公开类型与组件文档。
37
+ ## 场景用法
38
+
39
+ 以下示例从本地 `src/docs/components/popover.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./popover-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
40
+
41
+ ### 用途与选型
42
+
43
+ 围绕触发元素展示一块非模态浮动卡片,适合承载简短详情、辅助信息或轻量操作。
44
+
45
+
46
+ ### 何时使用
47
+
48
+ - 需要点击、悬浮、聚焦或右键触发一块贴近目标元素的内容。
49
+ - 需要展示比 Tooltip 更丰富的标题、说明或操作。
50
+ - 需要控制浮层位置、箭头、挂载容器或受控显隐状态。
51
+
52
+
53
+ ### 组件选择
54
+
55
+ | 需求 | 推荐组件 |
56
+ | --- | --- |
57
+ | 富内容浮动卡片 | `Popover` |
58
+ | 纯文字说明 | `Tooltip` |
59
+ | 操作菜单 | `Dropdown` |
60
+ | 二次确认 | `Popconfirm` |
61
+ | 封装新的浮层组件 | `Trigger` |
62
+
63
+ `Trigger` 是底层触发定位 primitive,不建议普通业务直接使用。
64
+
65
+
66
+ ### 基础用法
67
+
68
+ ```vue
69
+ <script setup lang="ts">
70
+ import 'x-next/style.css';
71
+ import { Popover, Button } from 'x-next';
72
+
73
+ </script>
74
+ <template>
75
+ <Popover title="项目进度" content="当前任务已完成 62%,还有 3 个待处理节点。">
76
+ <Button type="primary">查看进度</Button>
77
+ </Popover>
78
+ </template>
79
+ ```
80
+
81
+ ### 自定义内容
82
+
83
+ ```vue
84
+ <script setup lang="ts">
85
+ import 'x-next/style.css';
86
+ import { Popover, Button } from 'x-next';
87
+
88
+ </script>
89
+ <template>
90
+ <Popover show-arrow>
91
+ <Button>查看详情</Button>
92
+ <template #title>节点详情</template>
93
+ <template #content>
94
+ <div>
95
+ <span>负责人:产品运营组</span>
96
+ <span>预计完成:今天 18:00</span>
97
+ <Button size="small" type="primary">进入任务</Button>
98
+ </div>
99
+ </template>
100
+ </Popover>
101
+ </template>
102
+ ```
103
+
104
+ ### 触发方式
105
+
106
+ ```vue
107
+ <script setup lang="ts">
108
+ import 'x-next/style.css';
109
+ import { Popover, Button } from 'x-next';
110
+
111
+ </script>
112
+ <template>
113
+ <Popover trigger="hover" content="鼠标移入触发元素时显示。">
114
+ <Button>悬浮</Button>
115
+ </Popover>
116
+
117
+ <Popover trigger="focus" content="获得焦点时显示,失焦后关闭。">
118
+ <Button>聚焦</Button>
119
+ </Popover>
120
+
121
+ <Popover trigger="contextMenu" align-point content="右键位置触发。">
122
+ <Button>右键</Button>
123
+ </Popover>
124
+ </template>
125
+ ```
126
+
127
+ ### 弹出位置
128
+
129
+ ```vue
130
+ <script setup lang="ts">
131
+ import 'x-next/style.css';
132
+ import { Popover, Button } from 'x-next';
133
+
134
+ </script>
135
+ <template>
136
+ <Popover position="top" content="上方弹出">
137
+ <Button>Top</Button>
138
+ </Popover>
139
+ <Popover position="right" content="右侧弹出">
140
+ <Button>Right</Button>
141
+ </Popover>
142
+ </template>
143
+ ```
144
+
145
+ ### 箭头和偏移
146
+
147
+ ```vue
148
+ <script setup lang="ts">
149
+ import 'x-next/style.css';
150
+ import { Popover, Button } from 'x-next';
151
+
152
+ </script>
153
+ <template>
154
+ <Popover
155
+ show-arrow
156
+ :popup-offset="12"
157
+ title="带箭头的浮层"
158
+ content="通过 popupOffset 控制与触发元素的距离。"
159
+ >
160
+ <Button>带箭头</Button>
161
+ </Popover>
162
+ </template>
163
+ ```
164
+
165
+ ### 受控显隐
166
+
167
+ ```vue
168
+ <script setup lang="ts">
169
+ import 'x-next/style.css';
170
+ import { Button, Popover } from 'x-next';
171
+ import { ref } from 'vue';
172
+
173
+ const visible = ref(false);
174
+ </script>
175
+ <template>
176
+ <Button @click="visible = !visible">
177
+ {{ visible ? '关闭' : '打开' }}
178
+ </Button>
179
+ <Popover
180
+ v-model:popup-visible="visible"
181
+ trigger="click"
182
+ title="受控 Popover"
183
+ content="外部按钮和触发器都可以同步显隐状态。"
184
+ >
185
+ <Button type="primary">受控触发器</Button>
186
+ </Popover>
187
+ </template>
188
+ ```
189
+
190
+ ### 局部容器
191
+
192
+ ```vue
193
+ <script setup lang="ts">
194
+ import 'x-next/style.css';
195
+ import { Popover, Button } from 'x-next';
196
+
197
+ </script>
198
+ <template>
199
+ <div id="popover-local-container" style="position: relative; min-height: 180px;">
200
+ <Popover
201
+ popup-container="#popover-local-container"
202
+ show-arrow
203
+ title="局部挂载"
204
+ content="局部挂载内容"
205
+ >
206
+ <Button>挂载到容器</Button>
207
+ </Popover>
208
+ </div>
209
+ </template>
210
+ ```
211
+
212
+ ### 保持挂载
213
+
214
+ ```vue
215
+ <script setup lang="ts">
216
+ import 'x-next/style.css';
217
+ import { Popover, Button } from 'x-next';
218
+ import { ref } from 'vue';
219
+
220
+ const visible = ref(false);
221
+ </script>
222
+ <template>
223
+ <Popover
224
+ v-model:popup-visible="visible"
225
+ :unmount-on-close="false"
226
+ title="保留 DOM"
227
+ content="关闭后保留浮层节点"
228
+ >
229
+ <Button>切换保留浮层</Button>
230
+ </Popover>
231
+ </template>
232
+ ```
233
+
234
+ ### 与 Popup 的关系
235
+
236
+ `Popover` 是后续推荐使用的通用浮动卡片组件。`Popup` 是早期命名,已放入即将废弃分组,当前仅作为迁移期兼容入口保留。
237
+
238
+
239
+
240
+ 返回 [AI 索引](../index.md)。先查本页与 [本地 API](./popover-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
@@ -0,0 +1,75 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Popup 完整公开 API
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
7
+
8
+ ## Popup API
9
+
10
+ 公开声明:`dist/components/popup/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
11
+
12
+ ### Props
13
+
14
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
15
+ | --- | --- | --- | --- | --- |
16
+ | popupVisible | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | undefined |
17
+ | defaultPopupVisible | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
18
+ | trigger | 见场景用法与类型 | undefined &#124; "click" &#124; "hover" &#124; "focus" &#124; "contextMenu" &#124; ("click" &#124; "hover" &#124; "focus" &#124; "contextMenu")[] | 否 | "click" |
19
+ | position | 见场景用法与类型 | undefined &#124; "top" &#124; "bottom" &#124; "right" &#124; "left" &#124; "tl" &#124; "tr" &#124; "bl" &#124; "br" &#124; "lt" &#124; "rt" &#124; "lb" &#124; "rb" | 否 | "bottom" |
20
+ | title | 见场景用法与类型 | undefined &#124; string &#124; number | 否 | 未声明 |
21
+ | content | 见场景用法与类型 | undefined &#124; string &#124; number | 否 | 未声明 |
22
+ | disabled | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
23
+ | popupOffset | 见场景用法与类型 | undefined &#124; number | 否 | 8 |
24
+ | popupTranslate | 见场景用法与类型 | undefined &#124; [number, number] &#124; { top?: [number, number] &#124; undefined; bottom?: [number, number] &#124; undefined; right?: [number, number] &#124; undefined; left?: [number, number] &#124; undefined; tl?: [number, number] &#124; undefined; tr?: [number, number] &#124; undefined; bl?: [number, number] &#124; undefined; br?: [number, number] &#124; undefined; lt?: [number, number] &#124; undefined; rt?: [number, number] &#124; undefined; lb?: [number, number] &#124; undefined; rb?: [number, number] &#124; undefined; } | 否 | 未声明 |
25
+ | showArrow | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
26
+ | alignPoint | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
27
+ | popupHoverStay | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
28
+ | blurToClose | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
29
+ | clickToClose | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
30
+ | clickOutsideToClose | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
31
+ | unmountOnClose | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
32
+ | contentClass | 见场景用法与类型 | undefined &#124; string &#124; { [x: string]: boolean; } &#124; (string &#124; Record<string, boolean>)[] | 否 | 未声明 |
33
+ | contentStyle | 见场景用法与类型 | undefined &#124; CSSProperties | 否 | 未声明 |
34
+ | arrowClass | 见场景用法与类型 | undefined &#124; string &#124; { [x: string]: boolean; } &#124; (string &#124; Record<string, boolean>)[] | 否 | 未声明 |
35
+ | arrowStyle | 见场景用法与类型 | undefined &#124; CSSProperties | 否 | 未声明 |
36
+ | popupStyle | 见场景用法与类型 | undefined &#124; CSSProperties | 否 | 未声明 |
37
+ | animationName | 见场景用法与类型 | undefined &#124; string | 否 | "x-zoom-in-fade-out" |
38
+ | duration | 见场景用法与类型 | undefined &#124; number &#124; { enter: number; leave: number; } | 否 | 未声明 |
39
+ | mouseEnterDelay | 见场景用法与类型 | undefined &#124; number | 否 | 100 |
40
+ | mouseLeaveDelay | 见场景用法与类型 | undefined &#124; number | 否 | 100 |
41
+ | focusDelay | 见场景用法与类型 | undefined &#124; number | 否 | 0 |
42
+ | autoFitPopupWidth | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
43
+ | autoFitPopupMinWidth | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
44
+ | autoFixPosition | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
45
+ | popupContainer | 见场景用法与类型 | undefined &#124; string &#124; HTMLElement | 否 | 未声明 |
46
+ | updateAtScroll | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
47
+ | autoFitPosition | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
48
+ | renderToBody | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | true |
49
+ | preventFocus | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
50
+ | scrollToClose | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
51
+ | scrollToCloseDistance | 见场景用法与类型 | undefined &#124; number | 否 | 0 |
52
+
53
+ ### Events
54
+
55
+ | 事件 | 用途 | 监听器签名(即事件参数) |
56
+ | --- | --- | --- |
57
+ | update:popupVisible | 见场景用法与类型 | undefined &#124; (visible: boolean) => any |
58
+ | popupVisibleChange | 见场景用法与类型 | undefined &#124; (visible: boolean) => any |
59
+ | show | 见场景用法与类型 | undefined &#124; () => any |
60
+ | hide | 见场景用法与类型 | undefined &#124; () => any |
61
+
62
+ ### Slots
63
+
64
+ | 名称 | 用途 | 公开类型 |
65
+ | --- | --- | --- |
66
+ | default | 见场景用法与类型 | any |
67
+ | title | 见场景用法与类型 | any |
68
+ | content | 见场景用法与类型 | any |
69
+
70
+ ### 实例方法
71
+
72
+ 没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
73
+
74
+
75
+ 返回 [Popup 用法](./popup.md)。
@@ -0,0 +1,52 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Popup AI 使用
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 先读 [通用接入](../core.md)。公开导出:`Popup`;主要模型:v-model:popup-visible。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./popup-api.md),包含本组件族全部子组件和别名。
7
+
8
+ 按需样式:`x-next/style/popup`(包含 base.css、popover.css、popup.css、trigger.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
9
+
10
+ ## 场景用法
11
+
12
+ 以下示例从本地 `src/docs/components/popup.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./popup-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
13
+
14
+ ### 用途与选型
15
+
16
+ Popup 即将废弃,当前仅作为迁移期兼容入口保留。新项目请使用 [Popover 气泡卡片](./popover.md)。
17
+
18
+ Popup 用于围绕触发元素展示一块自定义浮层内容。它现在基于 Popover 兼容实现,已有代码可以继续使用;后续新能力只会优先放在 Popover。
19
+
20
+
21
+ ### 基础用法
22
+
23
+ ```vue
24
+ <script setup lang="ts">
25
+ import 'x-next/style.css';
26
+ import { Popup, Button } from 'x-next';
27
+
28
+ </script>
29
+ <template>
30
+ <Popup title="兼容 Popup" content="Popup 仍可使用,但推荐迁移到 Popover。">
31
+ <Button type="primary">点击打开</Button>
32
+ </Popup>
33
+ </template>
34
+ ```
35
+
36
+ ### 迁移到 Popover
37
+
38
+ ```vue
39
+ <script setup lang="ts">
40
+ import 'x-next/style.css';
41
+ import { Popover, Button } from 'x-next';
42
+
43
+ </script>
44
+ <template>
45
+ <Popover title="推荐 Popover" content="Popover 是后续推荐使用的通用浮动卡片组件。">
46
+ <Button type="primary">使用 Popover</Button>
47
+ </Popover>
48
+ </template>
49
+ ```
50
+
51
+
52
+ 返回 [AI 索引](../index.md)。先查本页与 [本地 API](./popup-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
@@ -0,0 +1,44 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Progress 完整公开 API
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
7
+
8
+ ## Progress API
9
+
10
+ 公开声明:`dist/components/progress/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
11
+
12
+ ### Props
13
+
14
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
15
+ | --- | --- | --- | --- | --- |
16
+ | type | 进度条类型 | undefined &#124; "circle" &#124; "line" | 否 | "line" |
17
+ | size | 尺寸 | undefined &#124; "mini" &#124; "small" &#124; "medium" &#124; "large" | 否 | 未声明 |
18
+ | percent | 当前进度,内部按 0~1 归一化渲染 | undefined &#124; number | 否 | 0 |
19
+ | steps | 步骤条数量,大于 0 时启用步骤模式 | undefined &#124; number | 否 | 0 |
20
+ | animation | 是否开启线性进度动画 | undefined &#124; false &#124; true | 否 | false |
21
+ | strokeWidth | 进度条线宽 | undefined &#124; number | 否 | 未声明 |
22
+ | width | 线性进度条宽度;圆形进度条仅支持数字直径 | undefined &#124; string &#124; number | 否 | 未声明 |
23
+ | color | 进度条颜色,支持渐变对象 | undefined &#124; string &#124; { [x: string]: any; } | 否 | 未声明 |
24
+ | trackColor | 轨道颜色 | undefined &#124; string | 否 | 未声明 |
25
+ | bufferColor | 线性进度条缓冲轨道颜色 | undefined &#124; string &#124; { [x: string]: any; } | 否 | 未声明 |
26
+ | showText | 是否显示文本 | undefined &#124; false &#124; true | 否 | true |
27
+ | status | 状态 | undefined &#124; "normal" &#124; "success" &#124; "warning" &#124; "strong" &#124; "danger" | 否 | 未声明 |
28
+
29
+ ### Events
30
+
31
+ 未声明组件 emits;原生事件与包装透传按本页用法核实。
32
+
33
+ ### Slots
34
+
35
+ | 名称 | 用途 | 公开类型 |
36
+ | --- | --- | --- |
37
+ | text | 自定义进度文本 | undefined &#124; (scope: { percent: number; }) => any |
38
+
39
+ ### 实例方法
40
+
41
+ 没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
42
+
43
+
44
+ 返回 [Progress 用法](./progress.md)。
@@ -1,12 +1,14 @@
1
1
  <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
2
  # Progress AI 使用
3
3
 
4
- 适用版本:x-next@1.12.0;来源指纹:`9f9adf42b42dc1e551f500aabdcb7fb07b69a93ea44ff3dc1d16dab1a4c85843`。
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
5
 
6
- 先读 [通用接入](../core.md)。公开导出:`Progress`;模型:无;已核对事件:未在精选映射登记事件;其他 API 见下方用法。
6
+ 先读 [通用接入](../core.md)。公开导出:`Progress`;主要模型:无。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./progress-api.md),包含本组件族全部子组件和别名。
7
7
 
8
8
  按需样式:`x-next/style/progress`(包含 base.css、progress.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
9
9
 
10
+ ## 已核验行为与示例
11
+
10
12
  [组件文档与 live demo](https://x-next.yjmf.com/components/progress)。`percent` 为 **0 到 1** 的比例,默认 `0`,不是 0 到 100;超出范围会裁剪,非有限值显示为 0。默认 `type='line'`、`showText=true`、`animation=false`,`steps>0` 使用分段模式。
11
13
 
12
14
  无模型和业务 change 事件,由业务更新 `percent`。`status` 为 `'normal' | 'success' | 'warning' | 'strong' | 'danger'`,未设置时达到 1 自动为 success;显式 status 优先,`strong` 不表示完成。`text` 插槽提供 `{ percent }`。
@@ -30,4 +32,247 @@ function advance() { percent.value = Math.min(1, percent.value + 0.25); }
30
32
  </template>
31
33
  ```
32
34
 
33
- 返回 [AI 索引](../index.md)。精选示例不是完整 API 表,新能力先查同版本公开类型与组件文档。
35
+ ## 场景用法
36
+
37
+ 以下示例从本地 `src/docs/components/progress.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./progress-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
38
+
39
+ ### 用途与选型
40
+
41
+ 用于表达任务进度、上传状态或流程完成度。
42
+
43
+
44
+ ### 何时使用
45
+
46
+ - 需要展示一个耗时任务的当前完成比例。
47
+ - 需要表达上传、导入、部署、审批等流程的状态。
48
+ - 需要用步骤段落展示离散进度。
49
+
50
+
51
+ ### 基础用法
52
+
53
+ ```vue
54
+ <script setup lang="ts">
55
+ import 'x-next/style.css';
56
+ import { Progress } from 'x-next';
57
+
58
+ </script>
59
+ <template>
60
+ <Progress :percent="0.6" />
61
+ <Progress :percent="0.6" :show-text="false" />
62
+ </template>
63
+ ```
64
+
65
+ ### 动态进度
66
+
67
+ ```vue
68
+ <script setup lang="ts">
69
+ import 'x-next/style.css';
70
+ import { Progress, Button } from 'x-next';
71
+ import { onBeforeUnmount, ref } from 'vue';
72
+
73
+ const percent = ref(0.28);
74
+ let timer: number | undefined;
75
+
76
+ const clearTimer = () => {
77
+ if (timer) {
78
+ window.clearInterval(timer);
79
+ timer = undefined;
80
+ }
81
+ };
82
+
83
+ const start = () => {
84
+ clearTimer();
85
+ percent.value = 0;
86
+ timer = window.setInterval(() => {
87
+ percent.value = Math.min(1, Number((percent.value + 0.08).toFixed(2)));
88
+ if (percent.value >= 1) {
89
+ clearTimer();
90
+ }
91
+ }, 280);
92
+ };
93
+
94
+ const reset = () => {
95
+ clearTimer();
96
+ percent.value = 0.28;
97
+ };
98
+
99
+ onBeforeUnmount(clearTimer);
100
+ </script>
101
+ <template>
102
+ <Progress :percent="percent" animation />
103
+ <div class="actions">
104
+ <Button type="primary" size="small" @click="start">开始</Button>
105
+ <Button size="small" @click="reset">重置</Button>
106
+ </div>
107
+ </template>
108
+ ```
109
+
110
+ ### 状态
111
+
112
+ 五种状态与品牌状态族一一对应,line / circle / steps 三种形态都支持。
113
+
114
+ ```vue
115
+ <script setup lang="ts">
116
+ import 'x-next/style.css';
117
+ import { Progress } from 'x-next';
118
+
119
+ </script>
120
+ <template>
121
+ <Progress :percent="0.3" status="normal" />
122
+ <Progress :percent="0.45" status="warning" />
123
+ <Progress :percent="0.55" status="strong" />
124
+ <Progress :percent="0.6" status="danger" />
125
+ <Progress :percent="1" status="success" />
126
+ </template>
127
+ ```
128
+
129
+ ### 尺寸
130
+
131
+ 线性进度的 `mini`、`small`、`medium`、`large` 只改变线条和文本尺寸,不会改变进度条形态;圆形迷你进度请使用 `type="circle" size="mini"`。
132
+
133
+ ```vue
134
+ <script setup lang="ts">
135
+ import 'x-next/style.css';
136
+ import { Progress } from 'x-next';
137
+
138
+ </script>
139
+ <template>
140
+ <Progress size="mini" :percent="0.4" />
141
+ <Progress size="small" :percent="0.5" />
142
+ <Progress :percent="0.6" />
143
+ <Progress size="large" :percent="0.7" />
144
+ </template>
145
+ ```
146
+
147
+ ### 宽度与线宽
148
+
149
+ ```vue
150
+ <script setup lang="ts">
151
+ import 'x-next/style.css';
152
+ import { Progress } from 'x-next';
153
+
154
+ </script>
155
+ <template>
156
+ <Progress :percent="0.54" width="320px" :stroke-width="6" />
157
+ <Progress :percent="0.7" :stroke-width="10" status="warning" />
158
+ <Progress type="circle" :percent="0.62" :width="72" :stroke-width="5" />
159
+ <Progress type="circle" :percent="0.86" :width="88" :stroke-width="6" status="success" />
160
+ </template>
161
+ ```
162
+
163
+ ### 圆形进度
164
+
165
+ ```vue
166
+ <script setup lang="ts">
167
+ import 'x-next/style.css';
168
+ import { Progress } from 'x-next';
169
+
170
+ </script>
171
+ <template>
172
+ <Progress type="circle" :percent="0.45" />
173
+ <Progress type="circle" :percent="0.75" status="warning" />
174
+ <Progress type="circle" :percent="1" status="success" />
175
+ </template>
176
+ ```
177
+
178
+ ### 迷你圆形进度
179
+
180
+ ```vue
181
+ <script setup lang="ts">
182
+ import 'x-next/style.css';
183
+ import { Progress } from 'x-next';
184
+
185
+ </script>
186
+ <template>
187
+ <Progress type="circle" size="mini" :percent="0.4" />
188
+ <Progress type="circle" size="mini" :percent="0.65" status="warning" />
189
+ <Progress type="circle" size="mini" :percent="0.8" status="danger" />
190
+ <Progress type="circle" size="mini" :percent="1" status="success" />
191
+ </template>
192
+ ```
193
+
194
+ ### 步骤进度
195
+
196
+ ```vue
197
+ <script setup lang="ts">
198
+ import 'x-next/style.css';
199
+ import { Progress } from 'x-next';
200
+
201
+ </script>
202
+ <template>
203
+ <Progress :steps="5" :percent="0.4" />
204
+ <Progress :steps="8" :percent="0.5" status="warning" />
205
+ <Progress :steps="6" :percent="0.67" status="danger" :stroke-width="8" />
206
+ </template>
207
+ ```
208
+
209
+ ### 自定义颜色
210
+
211
+ ```vue
212
+ <script setup lang="ts">
213
+ import 'x-next/style.css';
214
+ import { Progress } from 'x-next';
215
+ const gradientColor = {
216
+ '0%': 'var(--x-color-success-6)',
217
+ '55%': 'var(--x-color-primary-6)',
218
+ '100%': 'var(--x-color-warning-6)',
219
+ };
220
+ </script>
221
+ <template>
222
+ <Progress
223
+ :percent="0.68"
224
+ color="var(--x-color-success-6)"
225
+ track-color="var(--x-color-success-1)"
226
+ />
227
+ <Progress :percent="0.72" :color="gradientColor" />
228
+ <Progress
229
+ :percent="0.55"
230
+ animation
231
+ color="var(--x-color-primary-6)"
232
+ buffer-color="var(--x-color-primary-1)"
233
+ />
234
+ </template>
235
+ ```
236
+
237
+ ### 自定义文本
238
+
239
+ ```vue
240
+ <script setup lang="ts">
241
+ import 'x-next/style.css';
242
+ import { Progress } from 'x-next';
243
+
244
+ </script>
245
+ <template>
246
+ <Progress :percent="0.75">
247
+ <template #text="{ percent }">
248
+ {{ Math.round(percent * 100) }} / 100
249
+ </template>
250
+ </Progress>
251
+ <Progress type="circle" :percent="0.32">
252
+ <template #text="{ percent }">
253
+ 已完成 {{ Math.round(percent * 100) }}%
254
+ </template>
255
+ </Progress>
256
+ </template>
257
+ ```
258
+
259
+ ### 边界值
260
+
261
+ `percent` 使用 `0~1` 的小数,组件内部会把非法值归一化到 `0~1` 再渲染。
262
+
263
+ ```vue
264
+ <script setup lang="ts">
265
+ import 'x-next/style.css';
266
+ import { Progress } from 'x-next';
267
+
268
+ </script>
269
+ <template>
270
+ <Progress :percent="-0.2" />
271
+ <Progress :percent="1.2" />
272
+ <Progress type="circle" :percent="-0.2" />
273
+ <Progress type="circle" :percent="1.2" />
274
+ </template>
275
+ ```
276
+
277
+
278
+ 返回 [AI 索引](../index.md)。先查本页与 [本地 API](./progress-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。