xt-element-ui 1.3.3 → 1.3.4
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 +72 -72
- package/LICENSE +21 -21
- package/README.md +240 -240
- package/docs/README.md +100 -100
- package/docs/components/base/xt-button.md +114 -114
- package/docs/components/base/xt-card-item.md +104 -104
- package/docs/components/base/xt-card.md +108 -108
- package/docs/components/base/xt-config-provider.md +199 -199
- package/docs/components/base/xt-flex-box.md +115 -115
- package/docs/components/base/xt-grid-box.md +302 -302
- package/docs/components/base/xt-input.md +150 -150
- package/docs/components/base/xt-map-provider.md +23 -23
- package/docs/components/base/xt-map.md +331 -331
- package/docs/components/base/xt-step-price.md +165 -165
- package/docs/components/base/xt-text.md +212 -212
- package/docs/components/base/xt-time.md +165 -165
- package/docs/components/extend/ex-bar.md +67 -67
- package/docs/components/extend/ex-button.md +62 -62
- package/docs/components/extend/ex-card.md +86 -86
- package/docs/components/extend/ex-chart.md +463 -463
- package/docs/components/extend/ex-icon.md +189 -189
- package/docs/components/extend/ex-line.md +70 -70
- package/docs/components/extend/ex-multi.md +155 -155
- package/docs/components/extend/ex-pie.md +69 -69
- package/docs/components/extend/ex-select-tree.md +210 -210
- package/docs/components/extend/ex-table.md +590 -590
- package/docs/components/extend/ex-upload.md +134 -134
- package/docs/components/utils/size.md +147 -147
- package/docs/components/utils/theme.md +182 -182
- package/lib/index.common.js +4112 -4122
- package/lib/index.umd.js +4072 -4081
- package/lib/index.umd.min.js +3 -3
- package/package.json +80 -81
- package/src/components/ex-button/index.js +7 -7
- package/src/components/ex-button/index.vue +66 -66
- package/src/components/ex-button/style/index.scss +67 -67
- package/src/components/ex-card/index.js +7 -7
- package/src/components/ex-card/index.vue +68 -68
- package/src/components/ex-card/style/index.scss +73 -73
- package/src/components/ex-chart/index.js +7 -7
- package/src/components/ex-chart/index.vue +136 -136
- package/src/components/ex-date-picker/index.js +7 -7
- package/src/components/ex-icon/index.js +7 -7
- package/src/components/ex-icon/index.vue +168 -168
- package/src/components/ex-icon/style/index.scss +7 -7
- package/src/components/ex-page/index.js +7 -7
- package/src/components/ex-select-tree/index.js +7 -7
- package/src/components/ex-table/ExTableCell.vue +22 -22
- package/src/components/ex-table/index.js +7 -7
- package/src/components/ex-table/virtualScrollData.js +35 -35
- package/src/components/ex-upload/index.js +7 -7
- package/src/components/index.scss +39 -39
- package/src/components/xt-button/index.js +7 -7
- package/src/components/xt-button/index.vue +97 -97
- package/src/components/xt-card/index.js +7 -7
- package/src/components/xt-card/style/index.scss +48 -48
- package/src/components/xt-card-item/index.js +7 -7
- package/src/components/xt-card-item/style/index copy.scss +71 -71
- package/src/components/xt-card-item/style/index.scss +82 -82
- package/src/components/xt-config-provider/index.js +7 -7
- package/src/components/xt-config-provider/index.vue +362 -362
- package/src/components/xt-config-provider/style/index.scss +11 -11
- package/src/components/xt-flex-box/index.js +7 -7
- package/src/components/xt-flex-box/style/index.scss +81 -81
- package/src/components/xt-grid-box/index.js +7 -7
- package/src/components/xt-grid-box/style/index.scss +92 -92
- package/src/components/xt-grid-item/index.js +7 -7
- package/src/components/xt-grid-item/index.vue +106 -106
- package/src/components/xt-input/index.js +7 -7
- package/src/components/xt-input/index.vue +66 -66
- package/src/components/xt-input/style/index.scss +84 -84
- package/src/components/xt-map/adapters/amap.js +235 -235
- package/src/components/xt-map/adapters/baidu.js +254 -254
- package/src/components/xt-map/adapters/base.js +267 -267
- package/src/components/xt-map/adapters/index.js +29 -29
- package/src/components/xt-map/adapters/tianditu.js +242 -242
- package/src/components/xt-map/config/xt-map-config.js +197 -197
- package/src/components/xt-map/index.js +8 -8
- package/src/components/xt-map/index.vue +351 -351
- package/src/components/xt-map/loaders/script-loader.js +114 -114
- package/src/components/xt-map/provider.vue +200 -200
- package/src/components/xt-map/style/index.scss +77 -77
- package/src/components/xt-map-provider/index.js +8 -8
- package/src/components/xt-step-price/index.js +10 -10
- package/src/components/xt-step-price/index.vue +272 -272
- package/src/components/xt-step-price/style/index.scss +123 -123
- package/src/components/xt-step-price-item/index.js +7 -7
- package/src/components/xt-step-price-item/index.vue +187 -187
- package/src/components/xt-text/index.js +7 -7
- package/src/components/xt-text/index.vue +1 -1
- package/src/components/xt-text/style/index.scss +92 -92
- package/src/components/xt-time/index.js +7 -7
- package/src/components/xt-time/index.vue +313 -313
- package/src/components/xt-time/style/index.scss +23 -23
- package/src/config/element-registry.js +135 -135
- package/src/index.js +162 -178
- package/src/styles/css-variables.scss +257 -257
- package/src/styles/theme/background.scss +5 -5
- package/src/styles/theme/border-radius.scss +3 -3
- package/src/styles/theme/borders.scss +3 -3
- package/src/styles/theme/colors.scss +101 -101
- package/src/styles/theme/component-variables.scss +69 -69
- package/src/styles/theme/dark-variables.scss +28 -28
- package/src/styles/theme/font.scss +12 -12
- package/src/styles/theme/index.scss +11 -11
- package/src/styles/theme/shadows.scss +2 -2
- package/src/styles/theme/spacing.scss +4 -4
- package/src/styles/theme/transitions.scss +2 -2
- package/src/styles/theme/typography.scss +4 -4
- package/src/styles/variables-export.scss +85 -85
- package/src/utils/index.js +191 -202
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="tag"
|
|
4
|
-
:class="iconClasses"
|
|
5
|
-
:style="iconStyle"
|
|
6
|
-
v-on="$listeners"
|
|
7
|
-
@click="handleClick"
|
|
8
|
-
>
|
|
9
|
-
<svg v-if="isSvgSprite" :style="svgStyle" aria-hidden="true">
|
|
10
|
-
<use :href="svgHref" />
|
|
11
|
-
</svg>
|
|
12
|
-
<slot v-else-if="hasDefaultSlot" />
|
|
13
|
-
</component>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
const customPrefixes = {}
|
|
18
|
-
|
|
19
|
-
const ExIcon = {
|
|
20
|
-
name: 'ExIcon',
|
|
21
|
-
inheritAttrs: false,
|
|
22
|
-
|
|
23
|
-
props: {
|
|
24
|
-
name: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
type: [String, Number],
|
|
30
|
-
default: ''
|
|
31
|
-
},
|
|
32
|
-
color: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: ''
|
|
35
|
-
},
|
|
36
|
-
spin: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
computed: {
|
|
43
|
-
hasDefaultSlot() {
|
|
44
|
-
return !!this.$slots.default
|
|
45
|
-
},
|
|
46
|
-
iconName() {
|
|
47
|
-
return (this.name || '').trim()
|
|
48
|
-
},
|
|
49
|
-
isElIcon() {
|
|
50
|
-
return /^el-icon-/.test(this.iconName)
|
|
51
|
-
},
|
|
52
|
-
isSvgInline() {
|
|
53
|
-
return this.iconName.indexOf('<svg') > -1
|
|
54
|
-
},
|
|
55
|
-
isSvgSprite() {
|
|
56
|
-
return /^(#|svg:)/.test(this.iconName)
|
|
57
|
-
},
|
|
58
|
-
isCustomFont() {
|
|
59
|
-
if (!this.iconName) return false
|
|
60
|
-
return !this.isElIcon && !this.isSvgInline && !this.isSvgSprite
|
|
61
|
-
},
|
|
62
|
-
svgHref() {
|
|
63
|
-
if (!this.isSvgSprite) return ''
|
|
64
|
-
const name = this.iconName.replace(/^svg:/, '').replace(/^#/, '')
|
|
65
|
-
return `#${name}`
|
|
66
|
-
},
|
|
67
|
-
needsExIconPrefix() {
|
|
68
|
-
if (!this.isCustomFont) return false
|
|
69
|
-
for (const prefix of Object.keys(customPrefixes)) {
|
|
70
|
-
if (this.iconName.indexOf(prefix) === 0) {
|
|
71
|
-
return false
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return true
|
|
75
|
-
},
|
|
76
|
-
tag() {
|
|
77
|
-
if (this.isSvgInline) return 'span'
|
|
78
|
-
return 'i'
|
|
79
|
-
},
|
|
80
|
-
iconClasses() {
|
|
81
|
-
const classes = []
|
|
82
|
-
if (this.isElIcon) {
|
|
83
|
-
classes.push(this.iconName)
|
|
84
|
-
} else if (this.isSvgSprite) {
|
|
85
|
-
classes.push('ex-icon-svg')
|
|
86
|
-
} else if (this.isCustomFont) {
|
|
87
|
-
if (this.needsExIconPrefix) classes.push('ex-icon')
|
|
88
|
-
classes.push(this.iconName)
|
|
89
|
-
} else if (this.isSvgInline) {
|
|
90
|
-
classes.push('ex-icon-inline-svg')
|
|
91
|
-
}
|
|
92
|
-
if (this.spin) classes.push('ex-icon-spin')
|
|
93
|
-
return classes
|
|
94
|
-
},
|
|
95
|
-
iconStyle() {
|
|
96
|
-
const style = {}
|
|
97
|
-
if (this.size) {
|
|
98
|
-
const s = typeof this.size === 'number' ? `${this.size}px` : this.size
|
|
99
|
-
style.fontSize = s
|
|
100
|
-
style.width = s
|
|
101
|
-
style.height = s
|
|
102
|
-
}
|
|
103
|
-
if (this.color) {
|
|
104
|
-
style.color = this.color
|
|
105
|
-
}
|
|
106
|
-
if (this.isSvgInline) {
|
|
107
|
-
style.display = 'inline-block'
|
|
108
|
-
style.verticalAlign = 'middle'
|
|
109
|
-
}
|
|
110
|
-
return style
|
|
111
|
-
},
|
|
112
|
-
svgStyle() {
|
|
113
|
-
return {
|
|
114
|
-
width: '1em',
|
|
115
|
-
height: '1em',
|
|
116
|
-
verticalAlign: '-0.15em',
|
|
117
|
-
fill: 'currentColor',
|
|
118
|
-
overflow: 'hidden'
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
mounted() {
|
|
124
|
-
if (this.isSvgInline && this.$el) {
|
|
125
|
-
this.$el.innerHTML = this.iconName
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
beforeUpdate() {
|
|
130
|
-
if (this.isSvgInline && this.$el) {
|
|
131
|
-
this.$el.innerHTML = this.iconName
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
methods: {
|
|
136
|
-
handleClick(e) {
|
|
137
|
-
this.$emit('click', e)
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
ExIcon.registerPrefix = function (prefix) {
|
|
143
|
-
if (prefix && typeof prefix === 'string') {
|
|
144
|
-
customPrefixes[prefix] = true
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export default ExIcon
|
|
149
|
-
</script>
|
|
150
|
-
|
|
151
|
-
<style lang="scss" scoped>
|
|
152
|
-
.ex-icon-svg {
|
|
153
|
-
display: inline-flex;
|
|
154
|
-
align-items: center;
|
|
155
|
-
justify-content: center;
|
|
156
|
-
vertical-align: middle;
|
|
157
|
-
font-size: inherit;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.ex-icon-spin {
|
|
161
|
-
animation: ex-icon-spin-rotate 1s linear infinite;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
@keyframes ex-icon-spin-rotate {
|
|
165
|
-
from { transform: rotate(0deg); }
|
|
166
|
-
to { transform: rotate(360deg); }
|
|
167
|
-
}
|
|
168
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
:class="iconClasses"
|
|
5
|
+
:style="iconStyle"
|
|
6
|
+
v-on="$listeners"
|
|
7
|
+
@click="handleClick"
|
|
8
|
+
>
|
|
9
|
+
<svg v-if="isSvgSprite" :style="svgStyle" aria-hidden="true">
|
|
10
|
+
<use :href="svgHref" />
|
|
11
|
+
</svg>
|
|
12
|
+
<slot v-else-if="hasDefaultSlot" />
|
|
13
|
+
</component>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
const customPrefixes = {}
|
|
18
|
+
|
|
19
|
+
const ExIcon = {
|
|
20
|
+
name: 'ExIcon',
|
|
21
|
+
inheritAttrs: false,
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
name: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: [String, Number],
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
color: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
},
|
|
36
|
+
spin: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
computed: {
|
|
43
|
+
hasDefaultSlot() {
|
|
44
|
+
return !!this.$slots.default
|
|
45
|
+
},
|
|
46
|
+
iconName() {
|
|
47
|
+
return (this.name || '').trim()
|
|
48
|
+
},
|
|
49
|
+
isElIcon() {
|
|
50
|
+
return /^el-icon-/.test(this.iconName)
|
|
51
|
+
},
|
|
52
|
+
isSvgInline() {
|
|
53
|
+
return this.iconName.indexOf('<svg') > -1
|
|
54
|
+
},
|
|
55
|
+
isSvgSprite() {
|
|
56
|
+
return /^(#|svg:)/.test(this.iconName)
|
|
57
|
+
},
|
|
58
|
+
isCustomFont() {
|
|
59
|
+
if (!this.iconName) return false
|
|
60
|
+
return !this.isElIcon && !this.isSvgInline && !this.isSvgSprite
|
|
61
|
+
},
|
|
62
|
+
svgHref() {
|
|
63
|
+
if (!this.isSvgSprite) return ''
|
|
64
|
+
const name = this.iconName.replace(/^svg:/, '').replace(/^#/, '')
|
|
65
|
+
return `#${name}`
|
|
66
|
+
},
|
|
67
|
+
needsExIconPrefix() {
|
|
68
|
+
if (!this.isCustomFont) return false
|
|
69
|
+
for (const prefix of Object.keys(customPrefixes)) {
|
|
70
|
+
if (this.iconName.indexOf(prefix) === 0) {
|
|
71
|
+
return false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return true
|
|
75
|
+
},
|
|
76
|
+
tag() {
|
|
77
|
+
if (this.isSvgInline) return 'span'
|
|
78
|
+
return 'i'
|
|
79
|
+
},
|
|
80
|
+
iconClasses() {
|
|
81
|
+
const classes = []
|
|
82
|
+
if (this.isElIcon) {
|
|
83
|
+
classes.push(this.iconName)
|
|
84
|
+
} else if (this.isSvgSprite) {
|
|
85
|
+
classes.push('ex-icon-svg')
|
|
86
|
+
} else if (this.isCustomFont) {
|
|
87
|
+
if (this.needsExIconPrefix) classes.push('ex-icon')
|
|
88
|
+
classes.push(this.iconName)
|
|
89
|
+
} else if (this.isSvgInline) {
|
|
90
|
+
classes.push('ex-icon-inline-svg')
|
|
91
|
+
}
|
|
92
|
+
if (this.spin) classes.push('ex-icon-spin')
|
|
93
|
+
return classes
|
|
94
|
+
},
|
|
95
|
+
iconStyle() {
|
|
96
|
+
const style = {}
|
|
97
|
+
if (this.size) {
|
|
98
|
+
const s = typeof this.size === 'number' ? `${this.size}px` : this.size
|
|
99
|
+
style.fontSize = s
|
|
100
|
+
style.width = s
|
|
101
|
+
style.height = s
|
|
102
|
+
}
|
|
103
|
+
if (this.color) {
|
|
104
|
+
style.color = this.color
|
|
105
|
+
}
|
|
106
|
+
if (this.isSvgInline) {
|
|
107
|
+
style.display = 'inline-block'
|
|
108
|
+
style.verticalAlign = 'middle'
|
|
109
|
+
}
|
|
110
|
+
return style
|
|
111
|
+
},
|
|
112
|
+
svgStyle() {
|
|
113
|
+
return {
|
|
114
|
+
width: '1em',
|
|
115
|
+
height: '1em',
|
|
116
|
+
verticalAlign: '-0.15em',
|
|
117
|
+
fill: 'currentColor',
|
|
118
|
+
overflow: 'hidden'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
mounted() {
|
|
124
|
+
if (this.isSvgInline && this.$el) {
|
|
125
|
+
this.$el.innerHTML = this.iconName
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
beforeUpdate() {
|
|
130
|
+
if (this.isSvgInline && this.$el) {
|
|
131
|
+
this.$el.innerHTML = this.iconName
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
methods: {
|
|
136
|
+
handleClick(e) {
|
|
137
|
+
this.$emit('click', e)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
ExIcon.registerPrefix = function (prefix) {
|
|
143
|
+
if (prefix && typeof prefix === 'string') {
|
|
144
|
+
customPrefixes[prefix] = true
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export default ExIcon
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<style lang="scss" scoped>
|
|
152
|
+
.ex-icon-svg {
|
|
153
|
+
display: inline-flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
vertical-align: middle;
|
|
157
|
+
font-size: inherit;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ex-icon-spin {
|
|
161
|
+
animation: ex-icon-spin-rotate 1s linear infinite;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@keyframes ex-icon-spin-rotate {
|
|
165
|
+
from { transform: rotate(0deg); }
|
|
166
|
+
to { transform: rotate(360deg); }
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.ex-icon {
|
|
2
|
-
display: inline-block;
|
|
3
|
-
font-style: normal;
|
|
4
|
-
-webkit-font-smoothing: antialiased;
|
|
5
|
-
-moz-osx-font-smoothing: grayscale;
|
|
6
|
-
vertical-align: -0.15em;
|
|
7
|
-
}
|
|
1
|
+
.ex-icon {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-style: normal;
|
|
4
|
+
-webkit-font-smoothing: antialiased;
|
|
5
|
+
-moz-osx-font-smoothing: grayscale;
|
|
6
|
+
vertical-align: -0.15em;
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ExPage from './index.vue'
|
|
2
|
-
|
|
3
|
-
ExPage.install = function (Vue) {
|
|
4
|
-
Vue.component(ExPage.name, ExPage)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default ExPage
|
|
1
|
+
import ExPage from './index.vue'
|
|
2
|
+
|
|
3
|
+
ExPage.install = function (Vue) {
|
|
4
|
+
Vue.component(ExPage.name, ExPage)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default ExPage
|
|
8
8
|
export { ExPage }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ExSelectTree from './index.vue'
|
|
2
|
-
|
|
3
|
-
ExSelectTree.install = function (Vue) {
|
|
4
|
-
Vue.component(ExSelectTree.name, ExSelectTree)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default ExSelectTree
|
|
1
|
+
import ExSelectTree from './index.vue'
|
|
2
|
+
|
|
3
|
+
ExSelectTree.install = function (Vue) {
|
|
4
|
+
Vue.component(ExSelectTree.name, ExSelectTree)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default ExSelectTree
|
|
8
8
|
export { ExSelectTree }
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
name: 'ExTableCell',
|
|
4
|
-
functional: true,
|
|
5
|
-
props: {
|
|
6
|
-
row: Object,
|
|
7
|
-
index: Number,
|
|
8
|
-
formatter: Function,
|
|
9
|
-
column: { type: Object, default: null }
|
|
10
|
-
},
|
|
11
|
-
render: (h, ctx) => {
|
|
12
|
-
const params = {
|
|
13
|
-
row: ctx.props.row,
|
|
14
|
-
index: ctx.props.index
|
|
15
|
-
}
|
|
16
|
-
if (ctx.props.column) params.column = ctx.props.column
|
|
17
|
-
const isVnode = (it) => it !== null && it !== undefined && typeof it === 'object' && it.hasOwnProperty('componentOptions')
|
|
18
|
-
const renderNode = ctx.props.formatter(h, params)
|
|
19
|
-
if (renderNode === null || renderNode === undefined || renderNode === '') return h('span', '')
|
|
20
|
-
return isVnode(renderNode) ? renderNode : h('span', String(renderNode))
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'ExTableCell',
|
|
4
|
+
functional: true,
|
|
5
|
+
props: {
|
|
6
|
+
row: Object,
|
|
7
|
+
index: Number,
|
|
8
|
+
formatter: Function,
|
|
9
|
+
column: { type: Object, default: null }
|
|
10
|
+
},
|
|
11
|
+
render: (h, ctx) => {
|
|
12
|
+
const params = {
|
|
13
|
+
row: ctx.props.row,
|
|
14
|
+
index: ctx.props.index
|
|
15
|
+
}
|
|
16
|
+
if (ctx.props.column) params.column = ctx.props.column
|
|
17
|
+
const isVnode = (it) => it !== null && it !== undefined && typeof it === 'object' && it.hasOwnProperty('componentOptions')
|
|
18
|
+
const renderNode = ctx.props.formatter(h, params)
|
|
19
|
+
if (renderNode === null || renderNode === undefined || renderNode === '') return h('span', '')
|
|
20
|
+
return isVnode(renderNode) ? renderNode : h('span', String(renderNode))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
</script>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ExTable from './index.vue'
|
|
2
|
-
|
|
3
|
-
ExTable.install = function (Vue) {
|
|
4
|
-
Vue.component(ExTable.name, ExTable)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default ExTable
|
|
1
|
+
import ExTable from './index.vue'
|
|
2
|
+
|
|
3
|
+
ExTable.install = function (Vue) {
|
|
4
|
+
Vue.component(ExTable.name, ExTable)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default ExTable
|
|
8
8
|
export { ExTable }
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 生成虚拟滚动演示数据
|
|
3
|
-
* @param {number} count 数据条数,默认 10000
|
|
4
|
-
* @returns {Array}
|
|
5
|
-
*/
|
|
6
|
-
export function createVirtualScrollData(count = 10000) {
|
|
7
|
-
const departments = ['研发部', '产品部', '运营部', '财务部', '市场部']
|
|
8
|
-
const positions = ['工程师', '产品经理', '运营专员', '财务主管', '市场经理']
|
|
9
|
-
const statuses = ['在职', '休假', '离职']
|
|
10
|
-
|
|
11
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
12
|
-
id: i + 1,
|
|
13
|
-
name: `用户${i + 1}`,
|
|
14
|
-
department: departments[i % departments.length],
|
|
15
|
-
position: positions[i % positions.length],
|
|
16
|
-
email: `user${i + 1}@example.com`,
|
|
17
|
-
phone: `13800138${String(i).padStart(4, '0')}`,
|
|
18
|
-
address: `北京市朝阳区第${i + 1}号街道`,
|
|
19
|
-
salary: 5000 + Math.floor(Math.random() * 10000),
|
|
20
|
-
status: statuses[i % statuses.length]
|
|
21
|
-
}))
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** 虚拟滚动演示列配置 */
|
|
25
|
-
export const virtualScrollColumns = [
|
|
26
|
-
{ prop: 'id', label: 'ID', fixed: 'left', width: 80 },
|
|
27
|
-
{ prop: 'name', label: '姓名', fixed: 'left', width: 120 },
|
|
28
|
-
{ prop: 'department', label: '部门', width: 150 },
|
|
29
|
-
{ prop: 'position', label: '职位', width: 150 },
|
|
30
|
-
{ prop: 'email', label: '邮箱', width: 200 },
|
|
31
|
-
{ prop: 'phone', label: '电话', width: 130 },
|
|
32
|
-
{ prop: 'address', label: '地址', width: 200 },
|
|
33
|
-
{ prop: 'salary', label: '薪资', width: 120 },
|
|
34
|
-
{ prop: 'status', label: '状态', fixed: 'right', width: 100 }
|
|
35
|
-
]
|
|
1
|
+
/**
|
|
2
|
+
* 生成虚拟滚动演示数据
|
|
3
|
+
* @param {number} count 数据条数,默认 10000
|
|
4
|
+
* @returns {Array}
|
|
5
|
+
*/
|
|
6
|
+
export function createVirtualScrollData(count = 10000) {
|
|
7
|
+
const departments = ['研发部', '产品部', '运营部', '财务部', '市场部']
|
|
8
|
+
const positions = ['工程师', '产品经理', '运营专员', '财务主管', '市场经理']
|
|
9
|
+
const statuses = ['在职', '休假', '离职']
|
|
10
|
+
|
|
11
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
12
|
+
id: i + 1,
|
|
13
|
+
name: `用户${i + 1}`,
|
|
14
|
+
department: departments[i % departments.length],
|
|
15
|
+
position: positions[i % positions.length],
|
|
16
|
+
email: `user${i + 1}@example.com`,
|
|
17
|
+
phone: `13800138${String(i).padStart(4, '0')}`,
|
|
18
|
+
address: `北京市朝阳区第${i + 1}号街道`,
|
|
19
|
+
salary: 5000 + Math.floor(Math.random() * 10000),
|
|
20
|
+
status: statuses[i % statuses.length]
|
|
21
|
+
}))
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** 虚拟滚动演示列配置 */
|
|
25
|
+
export const virtualScrollColumns = [
|
|
26
|
+
{ prop: 'id', label: 'ID', fixed: 'left', width: 80 },
|
|
27
|
+
{ prop: 'name', label: '姓名', fixed: 'left', width: 120 },
|
|
28
|
+
{ prop: 'department', label: '部门', width: 150 },
|
|
29
|
+
{ prop: 'position', label: '职位', width: 150 },
|
|
30
|
+
{ prop: 'email', label: '邮箱', width: 200 },
|
|
31
|
+
{ prop: 'phone', label: '电话', width: 130 },
|
|
32
|
+
{ prop: 'address', label: '地址', width: 200 },
|
|
33
|
+
{ prop: 'salary', label: '薪资', width: 120 },
|
|
34
|
+
{ prop: 'status', label: '状态', fixed: 'right', width: 100 }
|
|
35
|
+
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ExUpload from './index.vue'
|
|
2
|
-
|
|
3
|
-
ExUpload.install = function (Vue) {
|
|
4
|
-
Vue.component(ExUpload.name, ExUpload)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default ExUpload
|
|
1
|
+
import ExUpload from './index.vue'
|
|
2
|
+
|
|
3
|
+
ExUpload.install = function (Vue) {
|
|
4
|
+
Vue.component(ExUpload.name, ExUpload)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default ExUpload
|
|
8
8
|
export { ExUpload }
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
// 组件样式统一入口文件
|
|
2
|
-
|
|
3
|
-
// Button 组件样式
|
|
4
|
-
@import './xt-button/style/index.scss';
|
|
5
|
-
|
|
6
|
-
// Card 组件样式
|
|
7
|
-
@import './xt-card/style/index.scss';
|
|
8
|
-
|
|
9
|
-
// CardItem 组件样式
|
|
10
|
-
@import './xt-card-item/style/index.scss';
|
|
11
|
-
|
|
12
|
-
// Input 组件样式
|
|
13
|
-
@import './xt-input/style/index.scss';
|
|
14
|
-
|
|
15
|
-
// FlexBox 组件样式
|
|
16
|
-
@import './xt-flex-box/style/index.scss';
|
|
17
|
-
|
|
18
|
-
// ConfigProvider 组件样式
|
|
19
|
-
@import './xt-config-provider/style/index.scss';
|
|
20
|
-
|
|
21
|
-
// Text 组件样式
|
|
22
|
-
@import './xt-text/style/index.scss';
|
|
23
|
-
|
|
24
|
-
// StepPrice 组件样式
|
|
25
|
-
@import './xt-step-price/style/index.scss';
|
|
26
|
-
|
|
27
|
-
// Time 组件样式
|
|
28
|
-
@import './xt-time/style/index.scss';
|
|
29
|
-
|
|
30
|
-
// ExButton 组件样式
|
|
31
|
-
@import './ex-button/style/index.scss';
|
|
32
|
-
|
|
33
|
-
// ExCard 组件样式
|
|
34
|
-
@import './ex-card/style/index.scss';
|
|
35
|
-
|
|
36
|
-
// GridBox 组件样式
|
|
37
|
-
@import './xt-grid-box/style/index.scss';
|
|
38
|
-
|
|
39
|
-
// ExIcon 组件样式
|
|
1
|
+
// 组件样式统一入口文件
|
|
2
|
+
|
|
3
|
+
// Button 组件样式
|
|
4
|
+
@import './xt-button/style/index.scss';
|
|
5
|
+
|
|
6
|
+
// Card 组件样式
|
|
7
|
+
@import './xt-card/style/index.scss';
|
|
8
|
+
|
|
9
|
+
// CardItem 组件样式
|
|
10
|
+
@import './xt-card-item/style/index.scss';
|
|
11
|
+
|
|
12
|
+
// Input 组件样式
|
|
13
|
+
@import './xt-input/style/index.scss';
|
|
14
|
+
|
|
15
|
+
// FlexBox 组件样式
|
|
16
|
+
@import './xt-flex-box/style/index.scss';
|
|
17
|
+
|
|
18
|
+
// ConfigProvider 组件样式
|
|
19
|
+
@import './xt-config-provider/style/index.scss';
|
|
20
|
+
|
|
21
|
+
// Text 组件样式
|
|
22
|
+
@import './xt-text/style/index.scss';
|
|
23
|
+
|
|
24
|
+
// StepPrice 组件样式
|
|
25
|
+
@import './xt-step-price/style/index.scss';
|
|
26
|
+
|
|
27
|
+
// Time 组件样式
|
|
28
|
+
@import './xt-time/style/index.scss';
|
|
29
|
+
|
|
30
|
+
// ExButton 组件样式
|
|
31
|
+
@import './ex-button/style/index.scss';
|
|
32
|
+
|
|
33
|
+
// ExCard 组件样式
|
|
34
|
+
@import './ex-card/style/index.scss';
|
|
35
|
+
|
|
36
|
+
// GridBox 组件样式
|
|
37
|
+
@import './xt-grid-box/style/index.scss';
|
|
38
|
+
|
|
39
|
+
// ExIcon 组件样式
|
|
40
40
|
@import './ex-icon/style/index.scss';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import XtButton from './index.vue'
|
|
2
|
-
|
|
3
|
-
XtButton.install = function (Vue) {
|
|
4
|
-
Vue.component(XtButton.name, XtButton)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default XtButton
|
|
1
|
+
import XtButton from './index.vue'
|
|
2
|
+
|
|
3
|
+
XtButton.install = function (Vue) {
|
|
4
|
+
Vue.component(XtButton.name, XtButton)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default XtButton
|
|
8
8
|
export { XtButton }
|