feat(timeline): 横向排列

This commit is contained in:
sight
2022-04-02 19:06:38 +08:00
parent 8f69699953
commit 34f2c9d992
4 changed files with 102 additions and 11 deletions

View File

@@ -6,10 +6,24 @@ export default {
<script setup lang="ts">
import "./index.less";
import { computed, withDefaults } from "vue";
export interface LayTimelineProps {
direction: "horizontal" | "vertical";
}
const props = withDefaults(defineProps<LayTimelineProps>(), {
direction: "vertical",
});
const timeLineClass = computed(() => [
"layui-timeline",
props.direction === "horizontal" ? "layui-timeline-horizontal" : "",
])
</script>
<template>
<ul class="layui-timeline">
<ul :class="timeLineClass">
<slot></slot>
</ul>
</template>