chushihua

This commit is contained in:
li
2026-01-26 23:20:48 +08:00
commit 7b5aab0206
22521 changed files with 3300090 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import Timeline from './src/main';
/* istanbul ignore next */
Timeline.install = function(Vue) {
Vue.component(Timeline.name, Timeline);
};
export default Timeline;
+73
View File
@@ -0,0 +1,73 @@
<template>
<li class="el-timeline-item">
<div class="el-timeline-item__tail"></div>
<div v-if="!$slots.dot"
class="el-timeline-item__node"
:class="[
`el-timeline-item__node--${size || ''}`,
`el-timeline-item__node--${type || ''}`
]"
:style="{
backgroundColor: color
}"
>
<i v-if="icon"
class="el-timeline-item__icon"
:class="icon"
></i>
</div>
<div v-if="$slots.dot" class="el-timeline-item__dot">
<slot name="dot"></slot>
</div>
<div class="el-timeline-item__wrapper">
<div v-if="!hideTimestamp && placement === 'top'"
class="el-timeline-item__timestamp is-top">
{{timestamp}}
</div>
<div class="el-timeline-item__content">
<slot></slot>
</div>
<div v-if="!hideTimestamp && placement === 'bottom'"
class="el-timeline-item__timestamp is-bottom">
{{timestamp}}
</div>
</div>
</li>
</template>
<script>
export default {
name: 'ElTimelineItem',
inject: ['timeline'],
props: {
timestamp: String,
hideTimestamp: {
type: Boolean,
default: false
},
placement: {
type: String,
default: 'bottom'
},
type: String,
color: String,
size: {
type: String,
default: 'normal'
},
icon: String
}
};
</script>
+38
View File
@@ -0,0 +1,38 @@
<template>
<ul class="el-timeline"
:class="{
'is-reverse': reverse
}">
<slot></slot>
</ul>
</template>
<script>
export default {
name: 'ElTimeline',
props: {
reverse: {
type: Boolean,
default: false
}
},
provide() {
return {
timeline: this
};
},
watch: {
reverse: {
handler(newVal) {
if (newVal) {
this.$slots.default = [...this.$slots.default].reverse();
}
},
immediate: true
}
}
};
</script>