Files
Yi.Admin/Yi.Bbs.Vue3/src/components/ScrollbarInfo.vue

52 lines
1.1 KiB
Vue
Raw Normal View History

2023-12-14 10:15:23 +08:00
<template>
2023-12-16 14:00:36 +08:00
<el-scrollbar>
2023-12-14 10:15:23 +08:00
<div class="scrollbar-flex-content">
2023-12-16 14:00:36 +08:00
<div v-for="item in recommendList" :key="item.id" class="scrollbar-item">
<el-tooltip
class="box-item"
effect="dark"
:content="item.dictLabel"
placement="top"
v-if="item.dictLabel.length > 5"
>
{{ item.dictLabel.slice(0, 5) + "..." }}
</el-tooltip>
<span v-else>
{{ item.dictLabel }}
</span>
</div>
2023-12-14 10:15:23 +08:00
</div>
</el-scrollbar>
2023-12-16 14:00:36 +08:00
</template>
2023-12-14 10:15:23 +08:00
2023-12-16 14:00:36 +08:00
<script setup>
import { onMounted, ref } from "vue";
import { getDictionaryList } from "@/apis/dictionaryApi.js";
const recommendList = ref([]);
onMounted(async () => {
const { data } = await getDictionaryList("bbs_type_lable");
recommendList.value = data;
});
</script>
<style scoped>
2023-12-14 10:15:23 +08:00
.scrollbar-flex-content {
display: flex;
}
.scrollbar-item {
2023-12-16 14:00:36 +08:00
cursor: pointer;
2023-12-14 10:15:23 +08:00
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 4rem;
height: 2.6rem;
2023-12-16 14:00:36 +08:00
margin: 0 0.2rem;
2023-12-14 10:15:23 +08:00
text-align: center;
border-radius: 4px;
2023-12-16 14:00:36 +08:00
background-color: #fafafa;
2023-12-14 10:15:23 +08:00
font-size: 14px;
}
2023-12-16 14:00:36 +08:00
</style>