Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d23aeb3

Browse files
author
Aaron Yong
committed
Support Timeline without groups
Fixes #31
1 parent 5d0828e commit d23aeb3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/components/Timeline.vue‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,15 @@ export default {
156156
},
157157
mounted() {
158158
const container = this.$refs.visualization;
159+
159160
this.visData.items = mountVisData(this, 'items');
160-
this.visData.groups = mountVisData(this, 'groups');
161-
this.timeline = new Timeline(container, this.visData.items, this.visData.groups, this.options);
161+
162+
if (this.groups && this.groups.length > 0) {
163+
this.visData.groups = mountVisData(this, 'groups');
164+
this.timeline = new Timeline(container, this.visData.items, this.visData.groups, this.options);
165+
} else {
166+
this.timeline = new Timeline(container, this.visData.items, this.options);
167+
}
162168
163169
this.events.forEach(eventName =>
164170
this.timeline.on(eventName, props => this.$emit(translateEvent(eventName), props))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /