【首页】推荐部分开发

一、【首页】推荐部分开发

1.1 完成效果图:

1.2 在components中新建组件Recommend.vue,代码如下:

<template>
	<view class='recommend bg-color'>
		<view class='recommend-item'>
			<image class='item-big' src='../../static/image/Children.jpg' mode=""></image>
			<view class='item-small'>
				<image class='item-img' src="../../static/image/Children1.jpg" mode=""></image>
				<image class='item-img' src="../../static/image/Children2.jpg" mode=""></image>
				<image class='item-img' src="../../static/image/Children3.jpg" mode=""></image>
			</view>
			<view class='recommend-item'>
				<image class='item-big' src='../../static/image/Furnishing.jpg' mode=""></image>
				<view class='item-small'>
					<image class='item-img' src="../../static/image/Furnishing1.jpg" mode=""></image>
					<image class='item-img' src="../../static/image/Furnishing2.jpg" mode=""></image>
					<image class='item-img' src="../../static/image/Furnishing3.jpg" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
</script>

<style scoped> 
.recommend{
	padding: 20rpx;
}
.recommend-item{
	display: flex;
	flex-direction: column;
	border-radius: 20rpx;
	border: 2rpx solid #55ffff;
	overflow: hidden;
	margin: 20rpx 0;
}
.item-big{
	width: 100%;
	height: 300rpx;
}
.item-small{
	width: 100%;
	height: 240rpx;
}
.item-img{
	width: 33.33333%;
	height: 240rpx;
}
</style>

1.3 在pages/index/index.vue中引入Recommend组件。

       1.3.1 import  Recommend  from'@/components/index/Recommend.vue'

       1.3.2 components:{

                       IndexSwiper,

                       Recommend

                }

       1.3.3 在template部分中使用

posted @   沈妙  阅读(21)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示