tiny-vue/examples/sites/demos/pc/app/time-line/custom-horizontal-timeline-...

44 lines
1004 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<tiny-time-line :data="data" :active="active" @click="click">
<template #top="{ slotScope: { index, name } }">
<p class="custom-top">{{ index }}.{{ name }}</p>
</template>
<template #bottom="{ slotScope: { time } }">
<p class="custom-bottom">
{{ time }}
</p>
</template>
</tiny-time-line>
</template>
<script setup>
import { ref } from 'vue'
import { TimeLine as TinyTimeLine, Modal } from '@opentiny/vue'
const active = ref(1)
const data = ref([
{ name: '已下单', time: '2019-11-11 00:01:30' },
{ name: '运输中', time: '2019-11-12 14:20:15' },
{ name: '已签收', time: '2019-11-14 20:45:50' }
])
function click(index, node) {
active.value = index
Modal.message({
message: 'click 事件,当前 index' + index + ' 节点信息:' + node.name + ',' + node.time,
status: 'info'
})
}
</script>
<style scoped>
.custom-top {
text-align: center;
}
.custom-bottom {
color: #8a8e99;
font-size: 12px;
}
</style>