修复 src 结构
This commit is contained in:
9
src/component/timelineItem/index.ts
Normal file
9
src/component/timelineItem/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from "vue";
|
||||
import Component from "./index.vue";
|
||||
import type { IDefineComponent } from "../type/index";
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || "LayTimelineItem", Component);
|
||||
};
|
||||
|
||||
export default Component as IDefineComponent;
|
||||
36
src/component/timelineItem/index.vue
Normal file
36
src/component/timelineItem/index.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis" v-if="slot.dot">
|
||||
<slot name="dot"></slot>
|
||||
</i>
|
||||
<i class="layui-icon layui-timeline-axis" v-else></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div v-if="simple" class="layui-timeline-title">
|
||||
{{ title }}
|
||||
</div>
|
||||
<h3 v-else class="layui-timeline-title">
|
||||
{{ title }}
|
||||
</h3>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayTimelineItem",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, useSlots } from "vue";
|
||||
|
||||
const slot = useSlots();
|
||||
|
||||
export interface LayTimelineItemProps {
|
||||
title: string;
|
||||
simple?: boolean;
|
||||
}
|
||||
|
||||
const props = defineProps<LayTimelineItemProps>();
|
||||
</script>
|
||||
Reference in New Issue
Block a user