Skip to content

Commit

Permalink
ISVJ-8206 地图大屏时间轴点组件显示不全 review by luox
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxianhuii committed May 22, 2024
1 parent de225b4 commit 8592961
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/common/time-line/TimeLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export default class SmTimeLine extends Mixins(Theme) {
@Prop({ default: true }) loop: boolean;
@Prop({ default: 3000 }) playInterval: string | number;
@Prop({ default: 0 }) currentIndex: number;
@Prop({ default: 'auto' }) left: string | number;
@Prop({ default: 'auto' }) right: string | number;
@Prop({ default: 'auto' }) top: string | number;
@Prop({ default: 'auto' }) bottom: string | number;
@Prop({
default() {
return [];
Expand Down Expand Up @@ -168,9 +172,10 @@ export default class SmTimeLine extends Mixins(Theme) {
...(this.emphasis || {})
},
padding: 0,
left: 0,
right: 0,
top: 'middle'
left: this.left,
right: this.right,
top: this.top,
bottom: this.bottom
},
tooltip: {
position: function(point, params, dom, rect, size) {
Expand Down
13 changes: 13 additions & 0 deletions src/common/time-line/__tests__/TimeLine.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,17 @@ describe('TimeLine.vue', () => {
});
wrapper.vm.setPlayState(true);
});

it('render margin', async () => {
wrapper = mount(SmTimeLine, {
propsData: {
data: ['3月15号数据', '3月16号数据', '3月17号数据'],
left: 20,
right: 20,
top: 20,
bottom: 20
}
});
expect(wrapper.vm.options.baseOption.timeline.left).toBe(20);
});
});

0 comments on commit 8592961

Please sign in to comment.