From b3b9772ddb8d59d4a7fd17fb6e2d663235fa95d9 Mon Sep 17 00:00:00 2001 From: Junji Zhi Date: Fri, 11 Jun 2021 20:01:02 -0400 Subject: [PATCH] Support item head color variants --- README.md | 9 ++--- dev/serve.vue | 5 +-- src/bootstrap-vue-timeline.vue | 61 ++++++++++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5291e89..ec0dfce 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,10 @@ export default Vue.extend({ > @@ -84,7 +85,7 @@ export default Vue.extend({ - [x] Loading spinner - [x] Support `reverse` props - [x] Custom timestamp format -- [ ] Support item head color variants +- [x] Support item head color variants - [ ] Support custom icons - [ ] Refactor timeline and item into separate components diff --git a/dev/serve.vue b/dev/serve.vue index fbb248d..4072162 100644 --- a/dev/serve.vue +++ b/dev/serve.vue @@ -43,8 +43,9 @@ export default Vue.extend({ diff --git a/src/bootstrap-vue-timeline.vue b/src/bootstrap-vue-timeline.vue index 927614b..190b37f 100644 --- a/src/bootstrap-vue-timeline.vue +++ b/src/bootstrap-vue-timeline.vue @@ -15,8 +15,12 @@ export default /*#__PURE__*/{ reverse: Boolean, loading: Boolean, dateFormat: String, + variant: String, }, methods: { + bsVariant() { + return this.variant || 'primary' + }, orderedItems() { let items = this.items if (this.loading) { @@ -57,7 +61,7 @@ export default /*#__PURE__*/{ :key="item.timestamp + item.title" class="flex-column align-items-start" > -
+
@@ -74,7 +78,7 @@ export default /*#__PURE__*/{ class="item-content" >
-
+
{{ item.title }}