75 lines
1.7 KiB
Vue
Raw Normal View History

2022-01-14 22:07:02 +08:00
<template>
<!-- 每一项组件的渲染 -->
2022-01-14 22:07:02 +08:00
<div class="item-box" v-for="(item, index) in menuOptions" :key="index">
<div class="list-header">
<AppleControlBtn :mini="true" :disabled="true"></AppleControlBtn>
<n-text class="list-header-text" depth="3">{{ item.title }}</n-text>
</div>
<div class="list-center go-flex-center">
2022-01-15 12:50:00 +08:00
<n-image
class="list-img"
object-fit="contain"
preview-disabled
:src="item.image"
:fallback-src="requireFallbackImg()"
/>
2022-01-14 22:07:02 +08:00
</div>
</div>
</template>
<script setup lang="ts">
import { AppleControlBtn } from '@/components/AppleControlBtn/index'
2022-01-15 12:50:00 +08:00
import { requireFallbackImg } from '@/utils'
2022-01-14 22:07:02 +08:00
defineProps({
menuOptions: {
type: Array,
default: () => []
}
})
</script>
<style lang="scss" scoped>
/* 列表项宽度 */
$itemWidth: 86%;
/* 内容高度 */
2022-01-15 22:35:32 +08:00
$centerHeight: 100px;
2022-01-14 22:07:02 +08:00
.item-box {
margin: 0 7%;
margin-bottom: 15px;
width: $itemWidth;
overflow: hidden;
border-radius: 6px;
2022-01-15 21:05:11 +08:00
cursor: pointer;
border: 1px solid rgba(0, 0, 0, 0);
@include filter-bg-color('background-color2');
2022-01-15 21:05:11 +08:00
@extend .go-transition;
&:hover {
@include hover-border-color('background-color4');
.list-img {
transform: scale(1.1);
}
}
2022-01-14 22:07:02 +08:00
.list-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 2px 15px;
@include filter-bg-color('background-color3');
2022-01-14 22:07:02 +08:00
&-text {
font-size: 12px;
margin-left: 8px;
}
}
.list-center {
padding: 6px 0;
height: $centerHeight;
2022-01-15 21:05:11 +08:00
overflow: hidden;
2022-01-14 22:07:02 +08:00
.list-img {
height: 100%;
border-radius: 6px;
2022-01-15 21:05:11 +08:00
@extend .go-transition;
2022-01-14 22:07:02 +08:00
}
}
}
</style>