优化:将完整引入Arco Design Vue调整为按需加载

This commit is contained in:
2022-08-07 11:23:44 +08:00
parent 917977a11d
commit cff6fcb1ce
6 changed files with 75 additions and 74 deletions

View File

@@ -0,0 +1,58 @@
<template>
<div class="timeline-wrapper">
<a-timeline
reverse
labelPosition="relative"
pending="未完待续 ······"
>
<a-timeline-item
v-for="article in articles"
:label="formatDate(article.date)"
>
<template #dot>
<icon-bug :style="{color: '#f53f3f'}" v-if="article.categories && article.categories.includes('Bug万象集')" />
<icon-bulb :style="{color: '#ff7d00'}" v-else-if="article.categories && article.categories.includes('杂碎逆袭史')" />
<icon-code v-else-if="article.categories && article.categories.includes('方案春秋志')" />
<icon-bookmark :style="{color: '#00b42a'}" v-else />
</template>
<a :href="article.path" class="title" target="_blank">{{ article.title }}</a>
</a-timeline-item>
</a-timeline>
</div>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue'
import articleData from '../../../../../article-data.json'
import { formatDate } from '../../utils.ts'
const articles = computed(() => articleData.sort((a, b) => a.date.localeCompare(b.date)))
</script>
<style scoped>
/** ---------------Arco样式--------------- */
:deep(.arco-timeline-item-content) {
color: var(--vp-c-text-1);
}
:deep(.arco-timeline-item-dot-custom) {
background-color: transparent;
}
:deep(.arco-timeline-item-label-relative > .arco-timeline-item-label) {
max-width: 145px;
}
:deep(.arco-icon) {
width: 1.3em;
height: 1.3em;
}
/** ---------------自定义样式--------------- */
.timeline-wrapper {
margin-top: 24px;
margin-left: 35px;
word-break: break-all;
}
.title {
font-weight: 400;
color: var(--vp-c-text-1);
}
</style>