xt-element-ui 1.4.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -20
- package/README.md +39 -35
- package/docs/README.md +25 -15
- package/docs/components/base/xt-badge.md +139 -0
- package/docs/components/base/xt-bar.md +182 -0
- package/docs/components/base/xt-chart.md +183 -0
- package/docs/components/base/xt-date-picker.md +111 -0
- package/docs/components/base/xt-icon.md +154 -0
- package/docs/components/base/xt-line.md +145 -0
- package/docs/components/base/xt-multi.md +278 -0
- package/docs/components/base/xt-page.md +84 -0
- package/docs/components/base/xt-pie.md +175 -0
- package/docs/components/base/xt-progress.md +134 -0
- package/docs/components/base/xt-select-tree.md +141 -0
- package/docs/components/base/xt-table.md +344 -0
- package/docs/components/base/xt-tabs.md +197 -0
- package/docs/components/base/xt-upload.md +85 -0
- package/lib/index.common.js +604 -824
- package/lib/index.css +1 -1
- package/lib/index.umd.js +609 -830
- package/lib/index.umd.min.js +4 -4
- package/package.json +1 -1
- package/src/components/index.scss +2 -8
- package/src/components/xt-button/index.js +1 -1
- package/src/components/xt-button/index.vue +43 -73
- package/src/components/xt-button/style/index.scss +51 -787
- package/src/components/xt-card/index.js +1 -2
- package/src/components/xt-card/index.vue +61 -21
- package/src/components/xt-card/style/index.scss +56 -32
- package/src/components/xt-card-item/index.vue +3 -3
- package/src/components/xt-chart/index.js +8 -0
- package/src/components/{ex-chart → xt-chart}/index.vue +13 -13
- package/src/components/{ex-chart → xt-chart}/pieList.vue +1 -1
- package/src/components/{ex-chart → xt-chart}/utils.js +1 -1
- package/src/components/xt-config-provider/index.vue +1 -1
- package/src/components/xt-date-picker/index.js +8 -0
- package/src/components/{ex-date-picker → xt-date-picker}/index.vue +1 -1
- package/src/components/xt-icon/index.js +8 -0
- package/src/components/{ex-icon → xt-icon}/index.vue +4 -4
- package/src/components/xt-layout/ExFieldset.vue +1 -1
- package/src/components/xt-page/index.js +8 -0
- package/src/components/{ex-page → xt-page}/index.vue +1 -1
- package/src/components/xt-select-tree/index.js +8 -0
- package/src/components/{ex-select-tree → xt-select-tree}/index.vue +1 -1
- package/src/components/xt-step-price/index.vue +13 -3
- package/src/components/xt-step-price-item/index.vue +8 -3
- package/src/components/{ex-table/ExTableCell.vue → xt-table/XtTableCell.vue} +1 -1
- package/src/components/xt-table/index.js +8 -0
- package/src/components/{ex-table → xt-table}/index.vue +6 -6
- package/src/components/xt-text/index.vue +130 -0
- package/src/components/xt-upload/index.js +8 -0
- package/src/index.js +15 -29
- package/src/utils/index.js +1 -1
- package/docs/components/extend/ex-bar.md +0 -68
- package/docs/components/extend/ex-button.md +0 -62
- package/docs/components/extend/ex-card.md +0 -86
- package/docs/components/extend/ex-chart.md +0 -463
- package/docs/components/extend/ex-date-picker.md +0 -0
- package/docs/components/extend/ex-icon.md +0 -189
- package/docs/components/extend/ex-line.md +0 -71
- package/docs/components/extend/ex-multi.md +0 -156
- package/docs/components/extend/ex-page.md +0 -0
- package/docs/components/extend/ex-pie.md +0 -70
- package/docs/components/extend/ex-select-tree.md +0 -210
- package/docs/components/extend/ex-table.md +0 -591
- package/docs/components/extend/ex-upload.md +0 -134
- package/src/components/ex-button/index.js +0 -8
- package/src/components/ex-button/index.vue +0 -67
- package/src/components/ex-button/style/index.scss +0 -67
- package/src/components/ex-card/index.js +0 -7
- package/src/components/ex-card/index.vue +0 -68
- package/src/components/ex-card/style/index.scss +0 -73
- package/src/components/ex-chart/index.js +0 -8
- package/src/components/ex-date-picker/index.js +0 -8
- package/src/components/ex-icon/index.js +0 -8
- package/src/components/ex-page/index.js +0 -8
- package/src/components/ex-select-tree/index.js +0 -8
- package/src/components/ex-table/index.js +0 -8
- package/src/components/ex-upload/index.js +0 -8
- package/src/config/element-registry.js +0 -136
- /package/src/components/{ex-chart/ExBar.vue → xt-chart/XtBar.vue} +0 -0
- /package/src/components/{ex-chart/ExLine.vue → xt-chart/XtLine.vue} +0 -0
- /package/src/components/{ex-chart/ExMulti.vue → xt-chart/XtMulti.vue} +0 -0
- /package/src/components/{ex-chart/ExPie.vue → xt-chart/XtPie.vue} +0 -0
- /package/src/components/{ex-chart → xt-chart}/theme/dark.js +0 -0
- /package/src/components/{ex-chart → xt-chart}/theme/white.js +0 -0
- /package/src/components/{ex-date-picker → xt-date-picker}/SearchDate.vue +0 -0
- /package/src/components/{ex-date-picker → xt-date-picker}/quarter.vue +0 -0
- /package/src/components/{ex-icon → xt-icon}/style/index.scss +0 -0
- /package/src/components/{ex-table → xt-table}/VirtualElTable.vue +0 -0
- /package/src/components/{ex-table → xt-table}/virtualScrollData.js +0 -0
- /package/src/components/{ex-upload → xt-upload}/index.vue +0 -0
- /package/src/components/{ex-upload → xt-upload}/preview.vue +0 -0
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<el-tooltip
|
|
3
|
+
v-if="showTooltip && ellipsis"
|
|
4
|
+
:content="displayTooltipContent"
|
|
5
|
+
:placement="tooltipPlacement"
|
|
6
|
+
:disabled="!isOverflow"
|
|
7
|
+
effect="dark"
|
|
8
|
+
>
|
|
9
|
+
<span
|
|
10
|
+
ref="textRef"
|
|
11
|
+
class="xt-text"
|
|
12
|
+
:class="[
|
|
13
|
+
type ? 'xt-text--' + type : '',
|
|
14
|
+
'xt-text--' + size,
|
|
15
|
+
{ 'xt-text--bold': bold },
|
|
16
|
+
{ 'xt-text--money': format === 'money' },
|
|
17
|
+
{ 'xt-text--ellipsis': ellipsis },
|
|
18
|
+
{ 'xt-text--ellipsis-multiline': ellipsis && ellipsisRows > 1 }
|
|
19
|
+
]"
|
|
20
|
+
:style="customStyle"
|
|
21
|
+
@mouseenter="handleMouseEnter"
|
|
22
|
+
>
|
|
23
|
+
<slot name="prefix">{{ prefix }}</slot>
|
|
24
|
+
<slot>
|
|
25
|
+
<template v-if="formattedValue !== undefined">{{ formattedValue }}</template>
|
|
26
|
+
</slot>
|
|
27
|
+
<slot name="suffix">{{ suffix }}</slot>
|
|
28
|
+
</span>
|
|
29
|
+
</el-tooltip>
|
|
2
30
|
<span
|
|
31
|
+
v-else
|
|
32
|
+
ref="textRef"
|
|
3
33
|
class="xt-text"
|
|
4
34
|
:class="[
|
|
5
35
|
type ? 'xt-text--' + type : '',
|
|
@@ -54,6 +84,19 @@ export default {
|
|
|
54
84
|
default: 1,
|
|
55
85
|
validator: (val) => val >= 1 && val <= 10
|
|
56
86
|
},
|
|
87
|
+
showTooltip: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: true
|
|
90
|
+
},
|
|
91
|
+
tooltipPlacement: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: 'top',
|
|
94
|
+
validator: (val) => ['top', 'bottom', 'left', 'right', 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-start', 'left-end', 'right-start', 'right-end'].includes(val)
|
|
95
|
+
},
|
|
96
|
+
tooltipContent: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: ''
|
|
99
|
+
},
|
|
57
100
|
|
|
58
101
|
// 格式化模式:normal 普通 | thousand 千分位 | money 金额
|
|
59
102
|
format: {
|
|
@@ -98,6 +141,11 @@ export default {
|
|
|
98
141
|
default: ''
|
|
99
142
|
}
|
|
100
143
|
},
|
|
144
|
+
data() {
|
|
145
|
+
return {
|
|
146
|
+
isOverflow: false
|
|
147
|
+
}
|
|
148
|
+
},
|
|
101
149
|
computed: {
|
|
102
150
|
// 兼容旧 money 属性:如果传了 money=true,自动切为金额模式
|
|
103
151
|
realFormat() {
|
|
@@ -115,6 +163,19 @@ export default {
|
|
|
115
163
|
return style
|
|
116
164
|
},
|
|
117
165
|
|
|
166
|
+
displayTooltipContent() {
|
|
167
|
+
if (this.tooltipContent) {
|
|
168
|
+
return this.tooltipContent
|
|
169
|
+
}
|
|
170
|
+
if (this.formattedValue !== undefined) {
|
|
171
|
+
return this.formattedValue
|
|
172
|
+
}
|
|
173
|
+
if (this.$slots.default && this.$slots.default.length > 0) {
|
|
174
|
+
return this.extractSlotText(this.$slots.default)
|
|
175
|
+
}
|
|
176
|
+
return this.value
|
|
177
|
+
},
|
|
178
|
+
|
|
118
179
|
formattedValue() {
|
|
119
180
|
const fmt = this.realFormat
|
|
120
181
|
const { value } = this
|
|
@@ -163,6 +224,75 @@ export default {
|
|
|
163
224
|
return value
|
|
164
225
|
}
|
|
165
226
|
}
|
|
227
|
+
},
|
|
228
|
+
methods: {
|
|
229
|
+
handleMouseEnter() {
|
|
230
|
+
this.checkOverflow()
|
|
231
|
+
},
|
|
232
|
+
checkOverflow() {
|
|
233
|
+
const el = this.$refs.textRef
|
|
234
|
+
if (!el) {
|
|
235
|
+
this.isOverflow = false
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (this.ellipsisRows > 1) {
|
|
240
|
+
this.isOverflow = el.scrollHeight > el.clientHeight
|
|
241
|
+
} else {
|
|
242
|
+
this.isOverflow = el.scrollWidth > el.clientWidth
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
extractSlotText(nodes) {
|
|
246
|
+
let text = ''
|
|
247
|
+
nodes.forEach(node => {
|
|
248
|
+
if (typeof node.children === 'string') {
|
|
249
|
+
text += node.children
|
|
250
|
+
} else if (typeof node.text === 'string') {
|
|
251
|
+
text += node.text
|
|
252
|
+
} else if (node.children && Array.isArray(node.children)) {
|
|
253
|
+
text += this.extractSlotText(node.children)
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
return text.trim()
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
mounted() {
|
|
260
|
+
if (this.ellipsis && this.showTooltip) {
|
|
261
|
+
this.$nextTick(() => {
|
|
262
|
+
this.checkOverflow()
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
266
|
+
if (this.ellipsis && this.showTooltip) {
|
|
267
|
+
this.checkOverflow()
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
this.$nextTick(() => {
|
|
271
|
+
if (this.$refs.textRef) {
|
|
272
|
+
this._resizeObserver.observe(this.$refs.textRef)
|
|
273
|
+
}
|
|
274
|
+
})
|
|
275
|
+
},
|
|
276
|
+
beforeDestroy() {
|
|
277
|
+
if (this._resizeObserver) {
|
|
278
|
+
this._resizeObserver.disconnect()
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
watch: {
|
|
282
|
+
value() {
|
|
283
|
+
if (this.ellipsis && this.showTooltip) {
|
|
284
|
+
this.$nextTick(() => {
|
|
285
|
+
this.checkOverflow()
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
ellipsis(newVal) {
|
|
290
|
+
if (newVal && this.showTooltip) {
|
|
291
|
+
this.$nextTick(() => {
|
|
292
|
+
this.checkOverflow()
|
|
293
|
+
})
|
|
294
|
+
}
|
|
295
|
+
}
|
|
166
296
|
}
|
|
167
297
|
}
|
|
168
298
|
</script>
|
package/src/index.js
CHANGED
|
@@ -33,14 +33,11 @@ import XtGridItem from './components/xt-grid-item'
|
|
|
33
33
|
import XtProgress from './components/xt-progress'
|
|
34
34
|
import XtTabs from './components/xt-tabs'
|
|
35
35
|
import XtBadge from './components/xt-badge'
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import ExIcon from './components/ex-icon' // ExIcon 组件(支持 el-icon / svg / 自定义字体)
|
|
41
|
-
import ExTable from './components/ex-table' // ExTable 组件(基于 ElementUI Table 封装)
|
|
36
|
+
import XtDatePicker from './components/xt-date-picker'
|
|
37
|
+
import XtChart from './components/xt-chart' // XtChart 组件(基于 ECharts 封装)
|
|
38
|
+
import XtIcon from './components/xt-icon' // XtIcon 组件(支持 el-icon / svg / 自定义字体)
|
|
39
|
+
import XtTable from './components/xt-table' // XtTable 组件(基于 ElementUI Table 封装)
|
|
42
40
|
|
|
43
|
-
import { registerElementExComponents, registerElementDirectives } from './config/element-registry'
|
|
44
41
|
|
|
45
42
|
const components = [
|
|
46
43
|
XtButton,
|
|
@@ -60,12 +57,10 @@ const components = [
|
|
|
60
57
|
XtProgress,
|
|
61
58
|
XtTabs,
|
|
62
59
|
XtBadge,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
ExIcon,
|
|
68
|
-
ExTable
|
|
60
|
+
XtDatePicker,
|
|
61
|
+
XtChart,
|
|
62
|
+
XtIcon,
|
|
63
|
+
XtTable
|
|
69
64
|
]
|
|
70
65
|
|
|
71
66
|
const install = function (Vue, options = {}) {
|
|
@@ -104,13 +99,6 @@ const install = function (Vue, options = {}) {
|
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
101
|
|
|
107
|
-
try {
|
|
108
|
-
const ElementUI = require('element-ui')
|
|
109
|
-
registerElementExComponents(Vue, ElementUI)
|
|
110
|
-
registerElementDirectives(Vue, ElementUI)
|
|
111
|
-
} catch (e) {
|
|
112
|
-
console.warn('[XtElementUI] ElementUI 未安装,Ex 系列组件可能无法正常使用')
|
|
113
|
-
}
|
|
114
102
|
}
|
|
115
103
|
|
|
116
104
|
// 支持全局 script 标签引入
|
|
@@ -139,18 +127,16 @@ export default {
|
|
|
139
127
|
XtProgress,
|
|
140
128
|
XtTabs,
|
|
141
129
|
XtBadge,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
ExIcon,
|
|
146
|
-
ExTable
|
|
130
|
+
XtDatePicker,
|
|
131
|
+
XtIcon,
|
|
132
|
+
XtTable
|
|
147
133
|
}
|
|
148
134
|
|
|
149
|
-
//
|
|
150
|
-
export { default as
|
|
135
|
+
// XtChart 组件按需导出(使用时需自行安装 echarts 依赖)
|
|
136
|
+
export { default as XtChart } from './components/xt-chart'
|
|
151
137
|
|
|
152
|
-
//
|
|
153
|
-
export { createVirtualScrollData, virtualScrollColumns } from './components/
|
|
138
|
+
// XtTable 虚拟滚动演示数据工具
|
|
139
|
+
export { createVirtualScrollData, virtualScrollColumns } from './components/xt-table/virtualScrollData'
|
|
154
140
|
|
|
155
141
|
// 导出工具函数和变量
|
|
156
142
|
export {
|
package/src/utils/index.js
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
## ExBar - 柱状图组件
|
|
2
|
-
|
|
3
|
-
基于 ECharts 封装的柱状图组件。
|
|
4
|
-
|
|
5
|
-
## 基本用法
|
|
6
|
-
|
|
7
|
-
::: demo 柱状图基础示例
|
|
8
|
-
```vue
|
|
9
|
-
<template>
|
|
10
|
-
<ExChart type="bar" :chartData="chartData" style="height: 400px;" />
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
export default {
|
|
15
|
-
data() {
|
|
16
|
-
return {
|
|
17
|
-
chartData: [
|
|
18
|
-
{ name: '张三', value: 65 },
|
|
19
|
-
{ name: '李四', value: 78 },
|
|
20
|
-
{ name: '王五', value: 89 },
|
|
21
|
-
{ name: '赵六', value: 95 },
|
|
22
|
-
{ name: '钱七', value: 72 }
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
28
|
-
```
|
|
29
|
-
:::
|
|
30
|
-
|
|
31
|
-
## 显示标记点
|
|
32
|
-
|
|
33
|
-
::: demo 显示最大值和最小值标记点
|
|
34
|
-
```vue
|
|
35
|
-
<template>
|
|
36
|
-
<ExChart type="bar" :chartData="chartData" :markPoint="true" style="height: 400px;" />
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script>
|
|
40
|
-
export default {
|
|
41
|
-
data() {
|
|
42
|
-
return {
|
|
43
|
-
chartData: [
|
|
44
|
-
{ name: '华东区', value: 1250 },
|
|
45
|
-
{ name: '华南区', value: 980 },
|
|
46
|
-
{ name: '华北区', value: 890 },
|
|
47
|
-
{ name: '西南区', value: 720 },
|
|
48
|
-
{ name: '西北区', value: 560 }
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
```
|
|
55
|
-
:::
|
|
56
|
-
|
|
57
|
-
## 属性说明
|
|
58
|
-
|
|
59
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
60
|
-
|------|------|--------|------|
|
|
61
|
-
| `chartData` | Array | [] | 图表数据 |
|
|
62
|
-
| `theme` | String | '' | 主题名称 |
|
|
63
|
-
| `size` | String | 'medium' | 尺寸 |
|
|
64
|
-
| `markPoint` | Boolean | false | 是否显示标记点 |
|
|
65
|
-
| `showZoom` | Boolean | false | 是否显示缩放功能 |
|
|
66
|
-
| `reverse` | Boolean | false | 是否反转坐标轴 |
|
|
67
|
-
| `longLable` | Boolean | false | 是否启用长标签模式 |
|
|
68
|
-
| `energyType` | String | '' | Y轴单位 |
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
## ExButton 按钮
|
|
2
|
-
|
|
3
|
-
基于 ElementUI 按钮封装,支持防抖和字体大小配置。
|
|
4
|
-
|
|
5
|
-
## 基础用法
|
|
6
|
-
|
|
7
|
-
::: demo 按钮基础示例
|
|
8
|
-
```vue
|
|
9
|
-
<template>
|
|
10
|
-
<div>
|
|
11
|
-
<ex-button>默认按钮</ex-button>
|
|
12
|
-
<ex-button type="primary">主要按钮</ex-button>
|
|
13
|
-
<ex-button type="success">成功按钮</ex-button>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
```
|
|
17
|
-
:::
|
|
18
|
-
|
|
19
|
-
## 字体大小
|
|
20
|
-
|
|
21
|
-
支持三种尺寸:`small`、`medium`、`large`
|
|
22
|
-
|
|
23
|
-
::: demo 按钮字体大小示例
|
|
24
|
-
```vue
|
|
25
|
-
<template>
|
|
26
|
-
<div>
|
|
27
|
-
<ex-button size="mini">迷你按钮</ex-button>
|
|
28
|
-
<ex-button size="small">小按钮</ex-button>
|
|
29
|
-
<ex-button size="medium">中按钮</ex-button>
|
|
30
|
-
<ex-button size="large">大按钮</ex-button>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
```
|
|
34
|
-
:::
|
|
35
|
-
|
|
36
|
-
## 继承 ConfigProvider 配置
|
|
37
|
-
|
|
38
|
-
当 ExButton 被包裹在 XtConfigProvider 中时,会自动继承字体大小配置:
|
|
39
|
-
|
|
40
|
-
::: demo 按钮继承字体大小示例
|
|
41
|
-
```vue
|
|
42
|
-
<template>
|
|
43
|
-
<xt-config-provider size="large">
|
|
44
|
-
<ex-button>自动继承大字体</ex-button>
|
|
45
|
-
</xt-config-provider>
|
|
46
|
-
</template>
|
|
47
|
-
```
|
|
48
|
-
:::
|
|
49
|
-
|
|
50
|
-
## Attributes
|
|
51
|
-
|
|
52
|
-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
53
|
-
|------|------|------|--------|--------|
|
|
54
|
-
| type | 按钮类型 | string | primary/success/warning/danger | — |
|
|
55
|
-
| size | 按钮尺寸 | string | small/medium/large | — |
|
|
56
|
-
| throttle | 点击节流时间 (ms) | number | — | 0 |
|
|
57
|
-
|
|
58
|
-
## Events
|
|
59
|
-
|
|
60
|
-
| 事件名 | 说明 | 回调参数 |
|
|
61
|
-
|--------|------|----------|
|
|
62
|
-
| click | 点击按钮时触发 | — |
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
## ExCard 卡片
|
|
2
|
-
|
|
3
|
-
基于 ElementUI 卡片封装,支持多种阴影模式和字体大小配置。
|
|
4
|
-
|
|
5
|
-
## 基础用法
|
|
6
|
-
|
|
7
|
-
::: demo 基础用法
|
|
8
|
-
```vue
|
|
9
|
-
<template>
|
|
10
|
-
<ex-card title="卡片标题">
|
|
11
|
-
<p>这是卡片内容</p>
|
|
12
|
-
</ex-card>
|
|
13
|
-
</template>
|
|
14
|
-
```
|
|
15
|
-
:::
|
|
16
|
-
|
|
17
|
-
## 阴影模式
|
|
18
|
-
|
|
19
|
-
支持三种阴影模式:`always`、`hover`、`never`
|
|
20
|
-
|
|
21
|
-
::: demo 阴影模式
|
|
22
|
-
```vue
|
|
23
|
-
<template>
|
|
24
|
-
<div>
|
|
25
|
-
<ex-card shadow="always">始终显示阴影</ex-card>
|
|
26
|
-
<ex-card shadow="hover">悬停时显示阴影</ex-card>
|
|
27
|
-
<ex-card shadow="never">不显示阴影</ex-card>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
```
|
|
31
|
-
:::
|
|
32
|
-
|
|
33
|
-
## 字体大小
|
|
34
|
-
|
|
35
|
-
支持三种尺寸:`small`、`medium`、`large`
|
|
36
|
-
|
|
37
|
-
::: demo 字体大小
|
|
38
|
-
```vue
|
|
39
|
-
<template>
|
|
40
|
-
<div>
|
|
41
|
-
<ex-card size="small" title="小卡片">
|
|
42
|
-
<p>小尺寸卡片内容</p>
|
|
43
|
-
</ex-card>
|
|
44
|
-
<ex-card size="medium" title="中卡片">
|
|
45
|
-
<p>中等尺寸卡片内容</p>
|
|
46
|
-
</ex-card>
|
|
47
|
-
<ex-card size="large" title="大卡片">
|
|
48
|
-
<p>大尺寸卡片内容</p>
|
|
49
|
-
</ex-card>
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
```
|
|
53
|
-
:::
|
|
54
|
-
|
|
55
|
-
## 继承 ConfigProvider 配置
|
|
56
|
-
|
|
57
|
-
当 ExCard 被包裹在 XtConfigProvider 中时,会自动继承字体大小配置。
|
|
58
|
-
|
|
59
|
-
::: demo 继承配置
|
|
60
|
-
```vue
|
|
61
|
-
<template>
|
|
62
|
-
<xt-config-provider size="large">
|
|
63
|
-
<ex-card title="卡片标题">
|
|
64
|
-
<p>自动继承大字体配置</p>
|
|
65
|
-
</ex-card>
|
|
66
|
-
</xt-config-provider>
|
|
67
|
-
</template>
|
|
68
|
-
```
|
|
69
|
-
:::
|
|
70
|
-
|
|
71
|
-
## Attributes
|
|
72
|
-
|
|
73
|
-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
74
|
-
|------|------|------|--------|--------|
|
|
75
|
-
| title | 卡片标题 | string | — | — |
|
|
76
|
-
| shadow | 阴影显示模式 | string | always/hover/never | always |
|
|
77
|
-
| bordered | 是否显示边框 | boolean | — | true |
|
|
78
|
-
| size | 卡片尺寸 | string | small/medium/large | — |
|
|
79
|
-
| body-class | 卡片 body 的类名 | string | — | — |
|
|
80
|
-
|
|
81
|
-
## Slots
|
|
82
|
-
|
|
83
|
-
| 名称 | 说明 |
|
|
84
|
-
|------|------|
|
|
85
|
-
| — | 卡片内容 |
|
|
86
|
-
| header | 卡片头部内容(优先级高于 title 属性) |
|