File tree Expand file tree Collapse file tree 3 files changed +63
-12
lines changed Expand file tree Collapse file tree 3 files changed +63
-12
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,10 @@ export default Vue.extend({
71
71
>
72
72
<b-timeline
73
73
:items =" timelineItems"
74
- :reverse =" true"
75
- :loading =" true"
76
- :date-format =" 'dd/MM/yy HH:mm:ss'"
74
+ :reverse =" false"
75
+ date-format =" dd/MM/yy HH:mm:ss"
76
+ variant =" primary"
77
+ loading
77
78
/>
78
79
</b-card >
79
80
</div >
@@ -84,7 +85,7 @@ export default Vue.extend({
84
85
- [x] Loading spinner
85
86
- [x] Support ` reverse ` props
86
87
- [x] Custom timestamp format
87
- - [ ] Support item head color variants
88
+ - [x ] Support item head color variants
88
89
- [ ] Support custom icons
89
90
- [ ] Refactor timeline and item into separate components
90
91
Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ export default Vue.extend({
43
43
<bootstrap-vue-timeline
44
44
:items =" timelineItems"
45
45
:reverse =" false"
46
- :loading =" true"
47
- :date-format =" 'dd/MM/yy HH:mm:ss'"
46
+ date-format =" dd/MM/yy HH:mm:ss"
47
+ variant =" primary"
48
+ loading
48
49
/>
49
50
</b-card >
50
51
</div >
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ export default /*#__PURE__*/{
15
15
reverse: Boolean ,
16
16
loading: Boolean ,
17
17
dateFormat: String ,
18
+ variant: String ,
18
19
},
19
20
methods: {
21
+ bsVariant () {
22
+ return this .variant || ' primary'
23
+ },
20
24
orderedItems () {
21
25
let items = this .items
22
26
if (this .loading ) {
@@ -57,15 +61,15 @@ export default /*#__PURE__*/{
57
61
:key =" item.timestamp + item.title"
58
62
class =" flex-column align-items-start"
59
63
>
60
- <div class =" item-head" />
64
+ <div : class =" ` item-head ${bsVariant()}` " />
61
65
<div
62
66
v-if =" index !== itemsCount() - 1"
63
67
class =" item-tail"
64
68
/>
65
69
66
70
<b-spinner
67
71
v-if =" item.spinner"
68
- variant =" primary "
72
+ : variant =" bsVariant() "
69
73
class =" ml-4"
70
74
/>
71
75
@@ -74,7 +78,7 @@ export default /*#__PURE__*/{
74
78
class =" item-content"
75
79
>
76
80
<div class =" d-flex w-100 justify-content-between" >
77
- <h5 class =" mt-2 mb-1" >
81
+ <h5 class =" mb-1" >
78
82
{{ item.title }}
79
83
</h5 >
80
84
<small
@@ -108,9 +112,6 @@ export default /*#__PURE__*/{
108
112
}
109
113
110
114
.item-head {
111
- background-color : #1890ff ;
112
- color : #1890ff ;
113
- border-color : #1890ff ;
114
115
position : absolute ;
115
116
width : 10px ;
116
117
height : 10px ;
@@ -132,4 +133,52 @@ export default /*#__PURE__*/{
132
133
margin : 0 0 0 18px ;
133
134
word-break : break-word ;
134
135
}
136
+
137
+ .primary {
138
+ background-color : #007bff ;
139
+ color : #007bff ;
140
+ border-color : #007bff ;
141
+ }
142
+
143
+ .secondary {
144
+ background-color : #6c757d ;
145
+ color : #6c757d ;
146
+ border-color : #6c757d ;
147
+ }
148
+
149
+ .success {
150
+ background-color : #28a745 ;
151
+ color : #28a745 ;
152
+ border-color : #28a745 ;
153
+ }
154
+
155
+ .info {
156
+ background-color : #17a2b8 ;
157
+ color : #17a2b8 ;
158
+ border-color : #17a2b8 ;
159
+ }
160
+
161
+ .warning {
162
+ background-color : #ffc107 ;
163
+ color : #ffc107 ;
164
+ border-color : #ffc107 ;
165
+ }
166
+
167
+ .danger {
168
+ background-color : #dc3545 ;
169
+ color : #dc3545 ;
170
+ border-color : #dc3545 ;
171
+ }
172
+
173
+ .light {
174
+ background-color : #f8f9fa ;
175
+ color : #f8f9fa ;
176
+ border-color : #f8f9fa ;
177
+ }
178
+
179
+ .dark {
180
+ background-color : #343a40 ;
181
+ color : #343a40 ;
182
+ border-color : #343a40 ;
183
+ }
135
184
</style >
You can’t perform that action at this time.
0 commit comments