xt-element-ui 1.2.4 → 1.2.6

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 (50) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/LICENSE +21 -0
  3. package/README.md +240 -104
  4. package/docs/README.md +100 -0
  5. package/docs/components/base/xt-button.md +114 -0
  6. package/docs/components/base/xt-card-item.md +104 -0
  7. package/docs/components/base/xt-card.md +108 -0
  8. package/docs/components/base/xt-config-provider.md +199 -0
  9. package/docs/components/base/xt-flex-box.md +115 -0
  10. package/docs/components/base/xt-grid-box.md +303 -0
  11. package/docs/components/base/xt-input.md +150 -0
  12. package/docs/components/base/xt-text.md +212 -0
  13. package/docs/components/extend/ex-bar.md +68 -0
  14. package/docs/components/extend/ex-button.md +62 -0
  15. package/docs/components/extend/ex-card.md +86 -0
  16. package/docs/components/extend/ex-chart.md +463 -0
  17. package/docs/components/extend/ex-icon.md +189 -0
  18. package/docs/components/extend/ex-line.md +71 -0
  19. package/docs/components/extend/ex-multi.md +156 -0
  20. package/docs/components/extend/ex-page.md +0 -0
  21. package/docs/components/extend/ex-pie.md +70 -0
  22. package/docs/components/extend/ex-select-tree.md +210 -0
  23. package/docs/components/extend/ex-table.md +591 -0
  24. package/docs/components/extend/ex-upload.md +134 -0
  25. package/docs/components/utils/size.md +148 -0
  26. package/docs/components/utils/theme.md +183 -0
  27. package/lib/index.common.js +640 -758
  28. package/lib/index.css +1 -1
  29. package/lib/index.umd.js +640 -758
  30. package/lib/index.umd.min.js +5 -5
  31. package/package.json +80 -39
  32. package/src/components/ex-chart/ExBar.vue +35 -29
  33. package/src/components/ex-chart/ExLine.vue +23 -14
  34. package/src/components/ex-chart/ExMulti.vue +66 -76
  35. package/src/components/ex-chart/ExPie.vue +26 -18
  36. package/src/components/ex-chart/index.vue +1 -4
  37. package/src/components/ex-chart/utils.js +149 -8
  38. package/src/components/ex-icon/index.js +2 -0
  39. package/src/components/ex-icon/index.vue +168 -0
  40. package/src/components/ex-icon/style/index.scss +7 -0
  41. package/src/components/ex-table/index.vue +3 -3
  42. package/src/components/index.scss +4 -1
  43. package/src/components/xt-card-item/images/bar.svg +1 -0
  44. package/src/components/xt-card-item/images/line.svg +1 -0
  45. package/src/components/xt-card-item/images/pie.svg +1 -0
  46. package/src/index.js +3 -0
  47. package/src/components/ex-chart/ExTrend.vue +0 -124
  48. package/src/components/ex-chart/theme/blue.js +0 -91
  49. package/src/components/ex-chart/theme/orange.js +0 -92
  50. package/src/components/ex-chart/theme/starry.js +0 -106
@@ -0,0 +1,303 @@
1
+ ## XtGridBox 网格布局组件
2
+
3
+ 基于 CSS Grid 实现的网格布局组件,提供强大的二维布局能力,支持响应式设计和灵活的配置选项。
4
+
5
+ ## 基本用法
6
+
7
+ ::: demo 基本用法
8
+ ```vue
9
+ <template>
10
+ <XtGridBox :columns="3" gap="16px">
11
+ <div style="padding: 16px; background: #f0f0f0; border-radius: 8px;">项目1</div>
12
+ <div style="padding: 16px; background: #f0f0f0; border-radius: 8px;">项目2</div>
13
+ <div style="padding: 16px; background: #f0f0f0; border-radius: 8px;">项目3</div>
14
+ <div style="padding: 16px; background: #f0f0f0; border-radius: 8px;">项目4</div>
15
+ <div style="padding: 16px; background: #f0f0f0; border-radius: 8px;">项目5</div>
16
+ <div style="padding: 16px; background: #f0f0f0; border-radius: 8px;">项目6</div>
17
+ </XtGridBox>
18
+ </template>
19
+ ```
20
+ :::
21
+
22
+ ## 属性说明
23
+
24
+ | 属性 | 类型 | 默认值 | 可选值 | 说明 |
25
+ |------|------|--------|--------|------|
26
+ | `columns` | String / Array / Number | `1fr` | - | 列配置,支持数字、字符串或数组 |
27
+ | `rows` | String / Array | `auto` | - | 行配置 |
28
+ | `gap` | String | - | - | 网格间距(同时控制行和列) |
29
+ | `rowGap` | String | - | - | 行间距 |
30
+ | `colGap` | String | - | - | 列间距 |
31
+ | `flow` | String | `row` | `row`、`column`、`row dense`、`column dense` | 自动排列方向 |
32
+ | `areas` | String / Array | - | - | 命名区域布局 |
33
+ | `align` | String | `stretch` | `start`、`end`、`center`、`stretch`、`baseline` | 子项对齐方式 |
34
+ | `justify` | String | `start` | `start`、`end`、`center`、`space-between`、`space-around`、`space-evenly`、`stretch` | 内容对齐方式 |
35
+ | `responsive` | Object | `{}` | - | 响应式断点配置 |
36
+
37
+ ## XtGridItem 子项组件
38
+
39
+ 配合 XtGridBox 使用的子项组件,支持跨行跨列等高级布局。
40
+
41
+ ### 属性说明
42
+
43
+ | 属性 | 类型 | 默认值 | 可选值 | 说明 |
44
+ |------|------|--------|--------|------|
45
+ | `span` | Number | `1` | >0 | 跨列数 |
46
+ | `rowSpan` | Number | `1` | >0 | 跨行数 |
47
+ | `start` | Number | `0` | >=0 | 起始列位置 |
48
+ | `rowStart` | Number | `0` | >=0 | 起始行位置 |
49
+ | `area` | String | - | - | 命名区域名称 |
50
+ | `justifySelf` | String | `auto` | `auto`、`start`、`end`、`center`、`stretch` | 水平对齐 |
51
+ | `alignSelf` | String | `auto` | `auto`、`start`、`end`、`center`、`stretch`、`baseline` | 垂直对齐 |
52
+
53
+ ## 示例
54
+
55
+ ### 基础网格
56
+
57
+ ::: demo 基础网格
58
+ ```vue
59
+ <template>
60
+ <XtGridBox :columns="4" gap="12px">
61
+ <div v-for="i in 8" :key="i" style="padding: 12px; background: #e6f7ff; border-radius: 4px; text-align: center;">{{ i }}</div>
62
+ </XtGridBox>
63
+ </template>
64
+ ```
65
+ :::
66
+
67
+ ### 列配置方式
68
+
69
+ ::: demo 列配置方式
70
+ ```vue
71
+ <template>
72
+ <div>
73
+ <!-- 数字方式:自动 repeat -->
74
+ <XtGridBox :columns="3" gap="8px" style="margin-bottom: 16px;">
75
+ <div v-for="i in 3" :key="i" style="padding: 12px; background: #f0f0f0;">{{ i }}</div>
76
+ </XtGridBox>
77
+
78
+ <!-- 字符串方式 -->
79
+ <XtGridBox columns="200px 1fr 1fr" gap="8px" style="margin-bottom: 16px;">
80
+ <div style="padding: 12px; background: #e6f7ff;">固定宽度</div>
81
+ <div style="padding: 12px; background: #f6ffed;">弹性1</div>
82
+ <div style="padding: 12px; background: #fff7e6;">弹性2</div>
83
+ </XtGridBox>
84
+
85
+ <!-- 数组方式 -->
86
+ <XtGridBox :columns="['100px', '1fr', '2fr']" gap="8px">
87
+ <div style="padding: 12px; background: #f9f0ff;">固定</div>
88
+ <div style="padding: 12px; background: #e6fffb;">1份</div>
89
+ <div style="padding: 12px; background: #fff7e6;">2份</div>
90
+ </XtGridBox>
91
+ </div>
92
+ </template>
93
+ ```
94
+ :::
95
+
96
+ ### 跨列跨行
97
+
98
+ ::: demo 跨列跨行
99
+ ```vue
100
+ <template>
101
+ <XtGridBox :columns="4" gap="12px">
102
+ <XtGridItem :span="2" style="padding: 24px; background: #1890ff; color: white; border-radius: 8px;">跨2列</XtGridItem>
103
+ <XtGridItem style="padding: 24px; background: #52c41a; color: white; border-radius: 8px;">普通</XtGridItem>
104
+ <XtGridItem style="padding: 24px; background: #52c41a; color: white; border-radius: 8px;">普通</XtGridItem>
105
+ <XtGridItem :rowSpan="2" style="padding: 48px 16px; background: #faad14; color: white; border-radius: 8px;">跨2行</XtGridItem>
106
+ <XtGridItem style="padding: 24px; background: #f5222d; color: white; border-radius: 8px;">普通</XtGridItem>
107
+ <XtGridItem style="padding: 24px; background: #f5222d; color: white; border-radius: 8px;">普通</XtGridItem>
108
+ <XtGridItem style="padding: 24px; background: #f5222d; color: white; border-radius: 8px;">普通</XtGridItem>
109
+ </XtGridBox>
110
+ </template>
111
+ ```
112
+ :::
113
+
114
+ ### 命名区域布局
115
+
116
+ ::: demo 命名区域布局
117
+ ```vue
118
+ <template>
119
+ <XtGridBox
120
+ :areas="[
121
+ 'header header header',
122
+ 'sidebar main main',
123
+ 'footer footer footer'
124
+ ]"
125
+ gap="12px"
126
+ >
127
+ <XtGridItem area="header" style="padding: 16px; background: #1890ff; color: white; border-radius: 8px;">Header</XtGridItem>
128
+ <XtGridItem area="sidebar" style="padding: 16px; background: #52c41a; color: white; border-radius: 8px;">Sidebar</XtGridItem>
129
+ <XtGridItem area="main" style="padding: 16px; background: #faad14; color: white; border-radius: 8px;">Main Content</XtGridItem>
130
+ <XtGridItem area="footer" style="padding: 16px; background: #f5222d; color: white; border-radius: 8px;">Footer</XtGridItem>
131
+ </XtGridBox>
132
+ </template>
133
+ ```
134
+ :::
135
+
136
+ ### 对齐方式
137
+
138
+ ::: demo 对齐方式
139
+ ```vue
140
+ <template>
141
+ <div>
142
+ <!-- 子项居中对齐 -->
143
+ <XtGridBox :columns="3" gap="8px" align="center" style="height: 120px; background: #f0f0f0; margin-bottom: 16px;">
144
+ <div style="padding: 8px 16px; background: white;">居中</div>
145
+ <div style="padding: 8px 16px; background: white;">居中</div>
146
+ <div style="padding: 8px 16px; background: white;">居中</div>
147
+ </XtGridBox>
148
+
149
+ <!-- 内容两端对齐 -->
150
+ <XtGridBox :columns="3" gap="8px" justify="space-between" style="background: #f0f0f0;">
151
+ <div style="padding: 8px 16px; background: white;">左</div>
152
+ <div style="padding: 8px 16px; background: white;">中</div>
153
+ <div style="padding: 8px 16px; background: white;">右</div>
154
+ </XtGridBox>
155
+ </div>
156
+ </template>
157
+ ```
158
+ :::
159
+
160
+ ### 独立间距控制
161
+
162
+ ::: demo 独立间距控制
163
+ ```vue
164
+ <template>
165
+ <XtGridBox :columns="3" rowGap="24px" colGap="8px">
166
+ <div v-for="i in 6" :key="i" style="padding: 12px; background: #e6f7ff; text-align: center;">{{ i }}</div>
167
+ </XtGridBox>
168
+ </template>
169
+ ```
170
+ :::
171
+
172
+ ### 自动填充布局
173
+
174
+ ::: demo 自动填充布局
175
+ ```vue
176
+ <template>
177
+ <XtGridBox columns="repeat(auto-fill, minmax(150px, 1fr))" gap="12px">
178
+ <div v-for="i in 8" :key="i" style="padding: 16px; background: #f0f0f0; text-align: center;">项目{{ i }}</div>
179
+ </XtGridBox>
180
+ </template>
181
+ ```
182
+ :::
183
+
184
+ ### 嵌套网格
185
+
186
+ ::: demo 嵌套网格
187
+ ```vue
188
+ <template>
189
+ <XtGridBox :columns="2" gap="16px">
190
+ <!-- 左侧 -->
191
+ <div style="padding: 16px; background: #e6f7ff;">
192
+ <h4>左侧面板</h4>
193
+ <XtGridBox :columns="1" gap="8px">
194
+ <div style="padding: 8px; background: white;">子项1</div>
195
+ <div style="padding: 8px; background: white;">子项2</div>
196
+ </XtGridBox>
197
+ </div>
198
+
199
+ <!-- 右侧 -->
200
+ <div style="padding: 16px; background: #f6ffed;">
201
+ <h4>右侧面板</h4>
202
+ <XtGridBox :columns="2" gap="8px">
203
+ <div style="padding: 8px; background: white;">A</div>
204
+ <div style="padding: 8px; background: white;">B</div>
205
+ <div style="padding: 8px; background: white;">C</div>
206
+ <div style="padding: 8px; background: white;">D</div>
207
+ </XtGridBox>
208
+ </div>
209
+ </XtGridBox>
210
+ </template>
211
+ ```
212
+ :::
213
+
214
+ ## 常见布局问题解决方案
215
+
216
+ ### 1. 网格内容溢出
217
+
218
+ **问题**:当网格内容过多时,网格会超出容器边界
219
+
220
+ **解决方案**:
221
+ ```vue
222
+ <template>
223
+ <XtGridBox :columns="3" gap="12px" style="min-height: 0;">
224
+ <div style="overflow-y: auto; max-height: 200px;">
225
+ <!-- 大量内容 -->
226
+ </div>
227
+ </XtGridBox>
228
+ </template>
229
+ ```
230
+
231
+ ### 2. 动态内容高度不一致
232
+
233
+ **问题**:网格子项内容高度不同导致布局错乱
234
+
235
+ **解决方案**:
236
+ ```vue
237
+ <template>
238
+ <!-- 使用 align 属性强制对齐 -->
239
+ <XtGridBox :columns="3" gap="12px" align="stretch">
240
+ <div style="display: flex; flex-direction: column;">
241
+ <div style="flex: 1;">内容区域</div>
242
+ <div>固定底部</div>
243
+ </div>
244
+ </XtGridBox>
245
+ </template>
246
+ ```
247
+
248
+ ### 3. 响应式列数调整
249
+
250
+ **问题**:在不同屏幕尺寸下需要不同的列数
251
+
252
+ **解决方案**:
253
+ ```vue
254
+ <template>
255
+ <!-- 使用 CSS 类配合媒体查询 -->
256
+ <XtGridBox class="responsive-grid" gap="12px">
257
+ <div v-for="i in 6" :key="i" style="padding: 12px; background: #f0f0f0;">{{ i }}</div>
258
+ </XtGridBox>
259
+ </template>
260
+
261
+ <style>
262
+ .responsive-grid {
263
+ grid-template-columns: repeat(1, 1fr);
264
+ }
265
+
266
+ @media (min-width: 576px) {
267
+ .responsive-grid {
268
+ grid-template-columns: repeat(2, 1fr);
269
+ }
270
+ }
271
+
272
+ @media (min-width: 768px) {
273
+ .responsive-grid {
274
+ grid-template-columns: repeat(3, 1fr);
275
+ }
276
+ }
277
+ </style>
278
+ ```
279
+
280
+ ### 4. 网格项无法收缩
281
+
282
+ **问题**:当父容器高度受限,子项无法自动收缩
283
+
284
+ **解决方案**:
285
+ ```vue
286
+ <template>
287
+ <div style="height: 300px; background: #f0f0f0;">
288
+ <XtGridBox :columns="2" style="height: 100%; min-height: 0;">
289
+ <div style="overflow-y: auto;">
290
+ <!-- 可滚动内容 -->
291
+ </div>
292
+ <div>固定内容</div>
293
+ </XtGridBox>
294
+ </div>
295
+ </template>
296
+ ```
297
+
298
+ ## 注意事项
299
+
300
+ 1. **min-height: 0**:当网格作为子元素嵌套在其他布局中时,建议设置 `min-height: 0` 以确保正确的收缩行为
301
+ 2. **响应式设计**:建议配合 CSS 媒体查询实现响应式布局
302
+ 3. **性能优化**:对于大量网格项,考虑使用 `flow="dense"` 优化空间利用率
303
+ 4. **嵌套使用**:网格可以嵌套使用,但注意控制嵌套层级以避免性能问题
@@ -0,0 +1,150 @@
1
+ ## XtInput 输入框组件
2
+
3
+ 输入框组件用于收集用户输入的信息。
4
+
5
+ ## 基本用法
6
+
7
+ ::: demo 基本用法
8
+ ```vue
9
+ <template>
10
+ <XtInput v-model="inputValue" placeholder="请输入内容"></XtInput>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ data() {
16
+ return {
17
+ inputValue: ''
18
+ }
19
+ }
20
+ }
21
+ </script>
22
+ ```
23
+ :::
24
+
25
+ ## 属性说明
26
+ | 属性 | 类型 | 默认值 | 说明 |
27
+ |------|------|--------|------|
28
+ | `value` | String / Number | - | 输入值(支持 v-model) |
29
+ | `placeholder` | String | '请输入内容' | 占位提示文本 |
30
+ | `color` | String | - | 自定义聚焦颜色 |
31
+
32
+ ## 示例
33
+
34
+ ### 基础输入框
35
+ ::: demo 基础输入框
36
+ ```vue
37
+ <template>
38
+ <XtInput v-model="username" placeholder="请输入用户名"></XtInput>
39
+ </template>
40
+
41
+ <script>
42
+ export default {
43
+ data() {
44
+ return {
45
+ username: ''
46
+ }
47
+ }
48
+ }
49
+ </script>
50
+ ```
51
+ :::
52
+
53
+ ### 自定义占位符
54
+
55
+ ::: demo 自定义占位符
56
+ ```vue
57
+ <template>
58
+ <XtInput v-model="email" placeholder="请输入您的邮箱地址"></XtInput>
59
+ </template>
60
+
61
+ <script>
62
+ export default {
63
+ data() {
64
+ return {
65
+ email: ''
66
+ }
67
+ }
68
+ }
69
+ </script>
70
+ ```
71
+ :::
72
+
73
+ ### 自定义聚焦颜色
74
+ ::: demo 自定义聚焦颜色
75
+ ```vue
76
+ <template>
77
+ <div style="display: flex; gap: 16px;">
78
+ <XtInput v-model="input1" placeholder="默认颜色"></XtInput>
79
+ <XtInput v-model="input2" placeholder="绿色主题" color="#52c41a"></XtInput>
80
+ <XtInput v-model="input3" placeholder="橙色主题" color="#faad14"></XtInput>
81
+ </div>
82
+ </template>
83
+
84
+ <script>
85
+ export default {
86
+ data() {
87
+ return {
88
+ input1: '',
89
+ input2: '',
90
+ input3: ''
91
+ }
92
+ }
93
+ }
94
+ </script>
95
+ ```
96
+ :::
97
+
98
+ ### 输入框组
99
+
100
+ ::: demo 输入框组
101
+ ```vue
102
+ <template>
103
+ <div style="display: flex; flex-direction: column; gap: 12px;">
104
+ <XtInput v-model="name" placeholder="姓名"></XtInput>
105
+ <XtInput v-model="phone" placeholder="手机"></XtInput>
106
+ <XtInput v-model="address" placeholder="地址"></XtInput>
107
+ </div>
108
+ </template>
109
+
110
+ <script>
111
+ export default {
112
+ data() {
113
+ return {
114
+ name: '',
115
+ phone: '',
116
+ address: ''
117
+ }
118
+ }
119
+ }
120
+ </script>
121
+ ```
122
+ :::
123
+
124
+ ### 监听输入事件
125
+
126
+ ::: demo 监听输入事件
127
+ ```vue
128
+ <template>
129
+ <div>
130
+ <XtInput :value="inputValue" placeholder="实时监听输入" @input="handleInput"></XtInput>
131
+ <p style="margin-top: 12px;">输入长度: {{ inputValue.length }}</p>
132
+ </div>
133
+ </template>
134
+
135
+ <script>
136
+ export default {
137
+ data() {
138
+ return {
139
+ inputValue: ''
140
+ }
141
+ },
142
+ methods: {
143
+ handleInput(value) {
144
+ this.inputValue = value
145
+ }
146
+ }
147
+ }
148
+ </script>
149
+ ```
150
+ :::
@@ -0,0 +1,212 @@
1
+ ## XtText 文本组件
2
+
3
+ 文本组件用于展示不同样式的文本内容。
4
+
5
+ ## 基本用法
6
+
7
+ ::: demo 基本用法
8
+ ```vue
9
+ <template>
10
+ <XtText type="primary">主要文本</XtText>
11
+ </template>
12
+ ```
13
+ :::
14
+
15
+ ## 属性说明
16
+ | 属性 | 类型 | 默认值 | 可选值 | 说明 |
17
+ |------|------|--------|--------|------|
18
+ | `type` | String | - | `primary`、`success`、`warning`、`danger` | 文本颜色类型 |
19
+ | `size` | String | base | `extra-large`、`large`、`medium`、`base`、`small`、`extra-small` | 字体大小 |
20
+ | `bold` | Boolean | false | - | 是否加粗 |
21
+ | `letterSpacing` | String / Number | - | - | 字间距 |
22
+ | `money` | Boolean | false | - | 是否启用金额格式化 |
23
+ | `value` | Number / String | - | - | 金额数值 |
24
+ | `currency` | String | CNY | `CNY`、`USD`、`EUR`、`JPY`、`GBP`、`AUD`、`CAD` | 货币类型 |
25
+ | `decimals` | Number | 2 | 0-10 | 小数位数 |
26
+ | `locale` | String | zh-CN | - | 语言环境 |
27
+ | `showSign` | Boolean | false | - | 是否显示正负号 |
28
+ | `prefix` | String | - | - | 自定义前缀 |
29
+ | `suffix` | String | - | - | 自定义后缀 |
30
+
31
+ ## 示例
32
+
33
+ ### 不同类型的文本
34
+ ::: demo 不同类型的文本
35
+ ```vue
36
+ <template>
37
+ <div style="display: flex; gap: 16px;">
38
+ <XtText type="primary">主要文本</XtText>
39
+ <XtText type="success">成功文本</XtText>
40
+ <XtText type="warning">警告文本</XtText>
41
+ <XtText type="danger">危险文本</XtText>
42
+ </div>
43
+ </template>
44
+ ```
45
+ :::
46
+
47
+ ### 不同字体大小
48
+ ::: demo 不同字体大小
49
+ ```vue
50
+ <template>
51
+ <div style="display: flex; flex-direction: column; gap: 8px;">
52
+ <XtText size="extra-large">特大号文本</XtText>
53
+ <XtText size="large">大号文本</XtText>
54
+ <XtText size="medium">中号文本</XtText>
55
+ <XtText size="base">基准文本</XtText>
56
+ <XtText size="small">小号文本</XtText>
57
+ <XtText size="extra-small">特小号文本</XtText>
58
+ </div>
59
+ </template>
60
+ ```
61
+ :::
62
+
63
+ ### 加粗文本
64
+
65
+ ::: demo 加粗文本
66
+ ```vue
67
+ <template>
68
+ <div style="display: flex; flex-direction: column; gap: 8px;">
69
+ <XtText bold>普通加粗文本</XtText>
70
+ <XtText type="primary" bold>主要加粗文本</XtText>
71
+ </div>
72
+ </template>
73
+ ```
74
+ :::
75
+
76
+ ### 字间距
77
+ ::: demo 字间距
78
+ ```vue
79
+ <template>
80
+ <div style="display: flex; flex-direction: column; gap: 8px;">
81
+ <XtText>正常字间距</XtText>
82
+ <XtText :letterSpacing="4">宽字距文本</XtText>
83
+ <XtText letterSpacing="8px">更宽字距文本</XtText>
84
+ </div>
85
+ </template>
86
+ ```
87
+ :::
88
+
89
+ ### 组合使用
90
+
91
+ ::: demo 组合使用
92
+ ```vue
93
+ <template>
94
+ <div style="display: flex; flex-direction: column; gap: 8px;">
95
+ <XtText type="success" bold>成功加粗文本</XtText>
96
+ <XtText type="danger" :letterSpacing="2">危险宽字距文本</XtText>
97
+ <XtText type="warning" bold :letterSpacing="3">警告加粗宽字距</XtText>
98
+ </div>
99
+ </template>
100
+ ```
101
+ :::
102
+
103
+ ### 段落文本
104
+
105
+ ::: demo 段落文本
106
+ ```vue
107
+ <template>
108
+ <p>
109
+ 这是一段普通文本,其中包含
110
+ <XtText type="primary">高亮的主要文本</XtText>
111
+
112
+ <XtText type="danger">危险提示文本</XtText>。
113
+ </p>
114
+ </template>
115
+ ```
116
+ :::
117
+
118
+ ### 数据展示
119
+
120
+ ::: demo 数据展示
121
+ ```vue
122
+ <template>
123
+ <div style="display: flex; align-items: baseline; gap: 8px;">
124
+ <XtText type="primary" bold style="font-size: 24px;">¥1,234.56</XtText>
125
+ <XtText type="warning" :letterSpacing="1">本月已节省¥520</XtText>
126
+ </div>
127
+ </template>
128
+ ```
129
+ :::
130
+
131
+ ### 金额格式化
132
+ ::: demo 金额格式化
133
+ ```vue
134
+ <template>
135
+ <div style="display: flex; flex-direction: column; gap: 12px;">
136
+ <div>
137
+ <span style="color: #909399; margin-right: 16px;">人民币:</span>
138
+ <XtText money :value="123456.78" type="primary" bold></XtText>
139
+ </div>
140
+ <div>
141
+ <span style="color: #909399; margin-right: 16px;">美元:</span>
142
+ <XtText money :value="123456.78" currency="USD"></XtText>
143
+ </div>
144
+ <div>
145
+ <span style="color: #909399; margin-right: 16px;">欧元:</span>
146
+ <XtText money :value="123456.78" currency="EUR" locale="de-DE"></XtText>
147
+ </div>
148
+ <div>
149
+ <span style="color: #909399; margin-right: 16px;">日元:</span>
150
+ <XtText money :value="123456" currency="JPY" :decimals="0"></XtText>
151
+ </div>
152
+ </div>
153
+ </template>
154
+ ```
155
+ :::
156
+
157
+ ### 金额显示正负号
158
+ ::: demo 金额显示正负号
159
+ ```vue
160
+ <template>
161
+ <div style="display: flex; flex-direction: column; gap: 8px;">
162
+ <div>
163
+ <span style="color: #909399; margin-right: 16px;">收入:</span>
164
+ <XtText money :value="5000" showSign type="success"></XtText>
165
+ </div>
166
+ <div>
167
+ <span style="color: #909399; margin-right: 16px;">支出:</span>
168
+ <XtText money :value="-2300" showSign type="danger"></XtText>
169
+ </div>
170
+ </div>
171
+ </template>
172
+ ```
173
+ :::
174
+
175
+ ### 自定义前缀后缀
176
+
177
+ ::: demo 自定义前缀后缀
178
+ ```vue
179
+ <template>
180
+ <div style="display: flex; flex-direction: column; gap: 8px;">
181
+ <div>
182
+ <XtText money :value="1000" prefix="合计:" suffix=" 元整" type="primary"></XtText>
183
+ </div>
184
+ <div>
185
+ <XtText money :value="98.5" prefix="折扣价:" type="warning"></XtText>
186
+ </div>
187
+ </div>
188
+ </template>
189
+ ```
190
+ :::
191
+
192
+ ### 金额样式组合
193
+
194
+ ::: demo 金额样式组合
195
+ ```vue
196
+ <template>
197
+ <div style="display: flex; flex-direction: column; gap: 12px;">
198
+ <div style="font-size: 28px;">
199
+ <XtText money :value="1234567.89" type="primary" bold></XtText>
200
+ </div>
201
+ <div>
202
+ <span style="color: #909399;">今日收益:</span>
203
+ <XtText money :value="1258.67" showSign type="success"></XtText>
204
+ </div>
205
+ <div>
206
+ <span style="color: #909399;">累计支出:</span>
207
+ <XtText money :value="-8920.30" showSign type="danger"></XtText>
208
+ </div>
209
+ </div>
210
+ </template>
211
+ ```
212
+ :::