lilishop-uniapp/pages/tabbar/home/template/tpl_menu.vue

61 lines
1.1 KiB
Vue
Raw Normal View History

2021-05-13 11:03:32 +08:00
<template>
<div class="layout">
<div class="menu-list">
2022-04-21 14:58:18 +08:00
<div
class="menu-item"
@click="modelNavigateTo(item)"
v-for="(item, index) in res.list"
:key="index"
>
2021-05-13 11:03:32 +08:00
<div>
<u-image
width="88rpx"
height="88rpx"
class="menu-img"
:src="item.img"
>
2022-04-21 14:58:18 +08:00
<u-loading slot="loading"></u-loading>
2021-05-13 11:03:32 +08:00
</u-image>
</div>
<div class="menu-title">{{ item.title }}</div>
</div>
</div>
</div>
</template>
<script>
2022-04-21 14:58:18 +08:00
import { modelNavigateTo } from "./tpl";
2021-05-13 11:03:32 +08:00
export default {
2022-04-21 14:58:18 +08:00
title: "五列菜单",
2021-05-13 11:03:32 +08:00
props: ["res"],
2022-04-21 14:58:18 +08:00
data() {
2021-05-13 11:03:32 +08:00
return {
modelNavigateTo,
2022-04-21 14:58:18 +08:00
};
},
2021-05-13 11:03:32 +08:00
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.menu-list {
display: flex;
align-items: center;
2022-04-21 14:58:18 +08:00
justify-content: space-between;
2021-05-13 11:03:32 +08:00
flex-wrap: wrap;
> .menu-item {
text-align: center;
width: 20%;
// flex: 1;
margin: 20rpx 0;
}
}
.menu-img {
display: flex;
margin: 0 auto;
width: 88rpx;
height: 88rpx;
}
.menu-title {
font-size: 24rpx;
}
</style>