xt-element-ui 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +479 -821
- package/lib/index.css +1 -1
- package/lib/index.umd.js +484 -827
- package/lib/index.umd.min.js +5 -5
- package/package.json +1 -1
- package/src/components/index.scss +2 -8
- package/src/components/xt-button/index.js +8 -8
- 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 +7 -8
- 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/{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-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,8 +1,7 @@
|
|
|
1
|
-
import XtCard from './index.vue'
|
|
2
|
-
|
|
3
|
-
XtCard.install = function (Vue) {
|
|
4
|
-
Vue.component(XtCard.name, XtCard)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default XtCard
|
|
8
|
-
export { XtCard }
|
|
1
|
+
import XtCard from './index.vue'
|
|
2
|
+
|
|
3
|
+
XtCard.install = function (Vue) {
|
|
4
|
+
Vue.component(XtCard.name, XtCard)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default XtCard
|
|
@@ -1,28 +1,68 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<slot>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
2
|
+
<el-card
|
|
3
|
+
class="ex-card"
|
|
4
|
+
:class="cardClasses"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<template #header v-if="$slots.header || title">
|
|
8
|
+
<slot name="header">{{ title }}</slot>
|
|
9
|
+
</template>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</el-card>
|
|
14
12
|
</template>
|
|
13
|
+
|
|
15
14
|
<script>
|
|
16
15
|
export default {
|
|
17
|
-
name:
|
|
16
|
+
name: 'XtCard',
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
inject: {
|
|
19
|
+
xtConfig: {
|
|
20
|
+
default: () => ({
|
|
21
|
+
theme: 'light',
|
|
22
|
+
size: 'medium',
|
|
23
|
+
primaryColor: '#1890ff'
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
},
|
|
18
27
|
props: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
title: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
shadow: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'always',
|
|
35
|
+
validator: (val) => ['always', 'hover', 'never'].includes(val)
|
|
36
|
+
},
|
|
37
|
+
bordered: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
bodyClass: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ''
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: null,
|
|
48
|
+
validator: (val) => !val || ['small', 'medium', 'large'].includes(val)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
finalSize() {
|
|
53
|
+
// 优先使用组件自身的 size,其次继承 XtConfigProvider 的 size,最后使用默认值
|
|
54
|
+
return this.size || this.xtConfig.size || 'medium'
|
|
55
|
+
},
|
|
56
|
+
cardClasses() {
|
|
57
|
+
return [
|
|
58
|
+
`ex-card-${this.shadow}`,
|
|
59
|
+
`ex-card-${this.finalSize}`,
|
|
60
|
+
{
|
|
61
|
+
'ex-card-no-border': !this.bordered,
|
|
62
|
+
[this.bodyClass]: this.bodyClass
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
26
66
|
}
|
|
27
67
|
}
|
|
28
|
-
</script>
|
|
68
|
+
</script>
|
|
@@ -1,49 +1,73 @@
|
|
|
1
|
+
// XtCard 组件样式
|
|
2
|
+
@import '../../../styles/element-theme.scss';
|
|
1
3
|
@import '../../../styles/variables.scss';
|
|
2
4
|
|
|
3
|
-
.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
.ex-card {
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
transition: all 0.3s;
|
|
8
|
+
font-size: var(--ex-card-font-size, 14px);
|
|
9
|
+
background-color: var(--el-bg-color-block, #ffffff);
|
|
10
|
+
color: var(--el-text-color-primary, #303133);
|
|
11
|
+
border-color: var(--el-border-color, #303133);
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
.el-card__header {
|
|
14
|
+
padding: var(--ex-card-header-padding, 16px 20px);
|
|
15
|
+
border-bottom: 1px solid var(--el-border-color, #ebeef5);
|
|
16
|
+
background-color: var(--el-bg-color-block-head, #ffffff);
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.el-card__body {
|
|
21
|
+
padding: var(--ex-card-body-padding, 20px);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ex-card-small {
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
|
|
28
|
+
.el-card__header {
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
}
|
|
14
31
|
}
|
|
15
32
|
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
.ex-card-medium {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
|
|
36
|
+
.el-card__header {
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
}
|
|
21
39
|
}
|
|
22
40
|
|
|
23
|
-
.
|
|
24
|
-
|
|
41
|
+
.ex-card-large {
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
|
|
44
|
+
.el-card__header {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
25
47
|
}
|
|
26
48
|
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
font-weight: 600;
|
|
30
|
-
color: var(--xt-color-primary, #1890ff);
|
|
49
|
+
.ex-card-always {
|
|
50
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
31
51
|
}
|
|
32
52
|
|
|
33
|
-
.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
.ex-card-hover {
|
|
54
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
|
|
58
|
+
}
|
|
37
59
|
}
|
|
38
60
|
|
|
39
|
-
.
|
|
40
|
-
|
|
61
|
+
.ex-card-never {
|
|
62
|
+
box-shadow: none;
|
|
63
|
+
border: 1px solid var(--el-border-color, #ebeef5);
|
|
41
64
|
}
|
|
42
65
|
|
|
43
|
-
.
|
|
44
|
-
|
|
66
|
+
.ex-card-no-border {
|
|
67
|
+
border: none;
|
|
68
|
+
|
|
69
|
+
.el-card__header {
|
|
70
|
+
border-bottom: none;
|
|
71
|
+
}
|
|
45
72
|
}
|
|
46
73
|
|
|
47
|
-
.xt-card.noPadding .card__body {
|
|
48
|
-
padding: 0;
|
|
49
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<xt-card class="xt-card-item" :bordered="false" :class="{ [`is-${type}`]: type ? true : false}">
|
|
3
3
|
<xt-flex-box content="between">
|
|
4
4
|
<div >
|
|
5
5
|
<div><xt-text bold size="extra-large">{{ title }}</xt-text></div>
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
<div style="height: 100%;">
|
|
13
13
|
<slot name="icon">
|
|
14
|
-
<xt-text size="extra-large" :type="type"><
|
|
14
|
+
<xt-text size="extra-large" :type="type"><xt-icon name="el-icon-user" :size="48" ></xt-icon></xt-text>
|
|
15
15
|
</slot>
|
|
16
16
|
</div>
|
|
17
17
|
</xt-flex-box>
|
|
18
|
-
</
|
|
18
|
+
</xt-card>
|
|
19
19
|
</template>
|
|
20
20
|
<script>
|
|
21
21
|
export default {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
2
|
+
<xt-bar v-if="type=='bar'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-bar>
|
|
3
|
+
<xt-line v-else-if="type=='line'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-line>
|
|
4
|
+
<xt-pie v-else-if="type=='pie'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-pie>
|
|
5
|
+
<xt-multi v-else-if="type=='multi'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-multi>
|
|
6
6
|
</template>
|
|
7
7
|
<script>
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import XtBar from "./XtBar.vue"
|
|
9
|
+
import XtLine from "./XtLine.vue"
|
|
10
|
+
import XtPie from "./XtPie.vue"
|
|
11
|
+
import XtMulti from "./XtMulti.vue"
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
name: "
|
|
14
|
+
name: "XtChart",
|
|
15
15
|
components: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
XtBar,
|
|
17
|
+
XtLine,
|
|
18
|
+
XtPie,
|
|
19
|
+
XtMulti
|
|
20
20
|
},
|
|
21
21
|
props: {
|
|
22
22
|
theme: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="pieLBox">
|
|
3
3
|
<div class="left">
|
|
4
|
-
<
|
|
4
|
+
<XtPie class="chart-box" :chart-data="chartData" :showLegend="false" :showLabel="false" :colors="colors"></XtPie>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="right">
|
|
7
7
|
<div v-for="(item, index) in chartData" :key="index" class="box">
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<script>
|
|
17
17
|
const customPrefixes = {}
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
name: '
|
|
19
|
+
const XtIcon = {
|
|
20
|
+
name: 'XtIcon',
|
|
21
21
|
inheritAttrs: false,
|
|
22
22
|
|
|
23
23
|
props: {
|
|
@@ -139,13 +139,13 @@ const ExIcon = {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
XtIcon.registerPrefix = function (prefix) {
|
|
143
143
|
if (prefix && typeof prefix === 'string') {
|
|
144
144
|
customPrefixes[prefix] = true
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
export default
|
|
148
|
+
export default XtIcon
|
|
149
149
|
</script>
|
|
150
150
|
|
|
151
151
|
<style lang="scss" scoped>
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
import Emitter from "element-ui/lib/mixins/emitter";
|
|
57
57
|
import { addResizeListener, removeResizeListener } from "element-ui/lib/utils/resize-event";
|
|
58
58
|
export default {
|
|
59
|
-
name: "
|
|
59
|
+
name: "XtSelectTree",
|
|
60
60
|
mixins: [Emitter],
|
|
61
61
|
inheritAttrs: false,
|
|
62
62
|
model: {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<el-table-column :key="child._key" v-bind="getColumnProps(child)">
|
|
54
54
|
<template v-if="child.render" v-slot="scope">{{ child.render(scope) }}</template>
|
|
55
55
|
<template v-else-if="child.formatter" v-slot="scope">
|
|
56
|
-
<
|
|
56
|
+
<XtTableCell
|
|
57
57
|
:row="scope.row"
|
|
58
58
|
:index="scope.$index"
|
|
59
59
|
:formatter="child.formatter"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<el-table-column v-else :key="col._key" v-bind="getColumnProps(col)">
|
|
75
75
|
<template v-if="col.render" v-slot="scope">{{ col.render(scope) }}</template>
|
|
76
76
|
<template v-else-if="col.formatter" v-slot="scope">
|
|
77
|
-
<
|
|
77
|
+
<XtTableCell
|
|
78
78
|
:row="scope.row"
|
|
79
79
|
:index="scope.$index"
|
|
80
80
|
:formatter="col.formatter"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<!-- 分页 -->
|
|
98
98
|
<div class="ex-table-footer" v-if="showPagination">
|
|
99
99
|
<el-pagination
|
|
100
|
-
:current-page="pagination.
|
|
100
|
+
:current-page="pagination.pageNum"
|
|
101
101
|
:page-size="pagination.pageSize"
|
|
102
102
|
:total="total"
|
|
103
103
|
:page-sizes="pagination.pageSizes || [10, 20, 50, 100]"
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
</template>
|
|
111
111
|
|
|
112
112
|
<script>
|
|
113
|
-
import
|
|
113
|
+
import XtTableCell from './XtTableCell.vue'
|
|
114
114
|
import VirtualElTable from './VirtualElTable.vue'
|
|
115
115
|
|
|
116
116
|
export default {
|
|
117
|
-
name: '
|
|
117
|
+
name: 'XtTable',
|
|
118
118
|
inheritAttrs: false,
|
|
119
|
-
components: {
|
|
119
|
+
components: { XtTableCell, VirtualElTable },
|
|
120
120
|
|
|
121
121
|
props: {
|
|
122
122
|
tableData: { type: Array, default: () => [] },
|
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轴单位 |
|