init
This commit is contained in:
98
src/component/timeline/index.less
Normal file
98
src/component/timeline/index.less
Normal file
@@ -0,0 +1,98 @@
|
||||
.layui-timeline {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.layui-timeline-item {
|
||||
position: relative;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.layui-timeline-axis {
|
||||
position: absolute;
|
||||
left: -5px;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
background-color: #fff;
|
||||
color: var(--global-checked-color);
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.layui-timeline-axis:hover {
|
||||
color: #ff5722;
|
||||
}
|
||||
|
||||
.layui-timeline-item:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 0;
|
||||
z-index: 0;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layui-timeline-item:first-child:before {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.layui-timeline-item:last-child:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-timeline-content {
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.layui-timeline-title {
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.layui-timeline-item:before {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-item {
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-axis {
|
||||
left: 47%;
|
||||
top: -4px;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-item:before {
|
||||
left: 0px;
|
||||
top: 5px;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-item:first-child:before {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-item:last-child:before {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-content {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.layui-timeline-horizontal .layui-timeline-title {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
line-height: 22px;
|
||||
}
|
||||
5
src/component/timeline/index.ts
Normal file
5
src/component/timeline/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { withInstall, WithInstallType } from "../../utils";
|
||||
import Component from "./index.vue";
|
||||
|
||||
const component: WithInstallType<typeof Component> = withInstall(Component);
|
||||
export default component;
|
||||
29
src/component/timeline/index.vue
Normal file
29
src/component/timeline/index.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayTimeline",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import "./index.less";
|
||||
import { computed, withDefaults } from "vue";
|
||||
|
||||
export interface TimelineProps {
|
||||
direction?: "horizontal" | "vertical";
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<TimelineProps>(), {
|
||||
direction: "vertical",
|
||||
});
|
||||
|
||||
const timeLineClass = computed(() => [
|
||||
"layui-timeline",
|
||||
props.direction === "horizontal" ? "layui-timeline-horizontal" : "",
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ul :class="timeLineClass">
|
||||
<slot></slot>
|
||||
</ul>
|
||||
</template>
|
||||
Reference in New Issue
Block a user