update the master branch to the latest
This commit is contained in:
parent
67d534df27
commit
23a0ba9831
611 changed files with 122648 additions and 0 deletions
5
src/components/timeline/index.js
Normal file
5
src/components/timeline/index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import Timeline from './timeline.vue';
|
||||
import TimelineItem from './timeline-item.vue';
|
||||
|
||||
Timeline.Item = TimelineItem;
|
||||
export default Timeline;
|
66
src/components/timeline/timeline-item.vue
Normal file
66
src/components/timeline/timeline-item.vue
Normal file
|
@ -0,0 +1,66 @@
|
|||
<template>
|
||||
<li :class="itemClasses">
|
||||
<div :class="tailClasses"></div>
|
||||
<div :class="headClasses" :style="customColor" ref="dot"><slot name="dot"></slot></div>
|
||||
<div :class="contentClasses">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
<script>
|
||||
const prefixCls = 'ivu-timeline';
|
||||
|
||||
export default {
|
||||
name: 'TimelineItem',
|
||||
props: {
|
||||
color: {
|
||||
type: String,
|
||||
default: 'blue'
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
dot: false
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
this.dot = this.$refs.dot.innerHTML.length ? true : false;
|
||||
},
|
||||
computed: {
|
||||
itemClasses () {
|
||||
return `${prefixCls}-item`;
|
||||
},
|
||||
tailClasses () {
|
||||
return `${prefixCls}-item-tail`;
|
||||
},
|
||||
headClasses () {
|
||||
return [
|
||||
`${prefixCls}-item-head`,
|
||||
{
|
||||
[`${prefixCls}-item-head-custom`]: this.dot,
|
||||
[`${prefixCls}-item-head-${this.color}`]: this.headColorShow
|
||||
}
|
||||
];
|
||||
},
|
||||
headColorShow () {
|
||||
return this.color == 'blue' || this.color == 'red' || this.color == 'green';
|
||||
},
|
||||
customColor () {
|
||||
let style = {};
|
||||
if (this.color) {
|
||||
if (!this.headColorShow) {
|
||||
style = {
|
||||
'color': this.color,
|
||||
'border-color': this.color
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return style;
|
||||
},
|
||||
contentClasses () {
|
||||
return `${prefixCls}-item-content`;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
28
src/components/timeline/timeline.vue
Normal file
28
src/components/timeline/timeline.vue
Normal file
|
@ -0,0 +1,28 @@
|
|||
<template>
|
||||
<ul :class="classes">
|
||||
<slot></slot>
|
||||
</ul>
|
||||
</template>
|
||||
<script>
|
||||
const prefixCls = 'ivu-timeline';
|
||||
|
||||
export default {
|
||||
name: 'Timeline',
|
||||
props: {
|
||||
pending: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classes () {
|
||||
return [
|
||||
`${prefixCls}`,
|
||||
{
|
||||
[`${prefixCls}-pending`]: this.pending
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue