当前位置:网站首页>8 popular recommended style layout
8 popular recommended style layout
2022-07-01 13:16:00 【Justion_】
home Component folder Recommend.vue
<template>
<div class="recommend">
<Card />
<ul>
<li v-for="(item, index) in RecommendList" :key="index">
<h2>
<img :src="item.imgUrl" alt="" />
</h2>
<div>
<h3>{
{ item.name }}</h3>
<p>{
{ item.content }}</p>
<div class="price">
<span>$</span>
<b>{
{ item.price }}</b>
</div>
</div>
</li>
</ul>
</div>
</template>
<script>
import Card from "@/components/home/Card";
export default {
components: {
Card,
},
data() {
return {
RecommendList: [
{
id: 1,
name: " Longjing 1 iron 250G",
content: " Fresh and mellow , Rations are preferred ",
price: 68,
imgUrl: "./images/h1.jpeg",
},
{
id: 2,
name: " Longjing 1 iron 250G",
content: " Fresh and mellow , Rations are preferred ",
price: 68,
imgUrl: "./images/h2.jpeg",
},
{
id: 3,
name: " Longjing 1 iron 250G",
content: " Fresh and mellow , Rations are preferred ",
price: 68,
imgUrl: "./images/h3.jpeg",
},
{
id: 4,
name: " Longjing 1 iron 250G",
content: " Fresh and mellow , Rations are preferred ",
price: 68,
imgUrl: "./images/h4.jpeg",
},
],
};
},
};
</script>
<style scoped>
.recommend ul li {
position: relative;
}
.recommend ul li h2 {
text-align: center;
}
.recommend ul li img {
width: 9.6rem;
height: 3.84rem;
border-radius: 0.32rem;
}
.recommend ul li > div {
position: absolute;
top: 0;
right: 0;
}
.recommend ul li > div {
position: absolute;
top: 0;
right: 0;
display: flex;
flex-direction: column;
padding: 0.5333rem;
}
.recommend ul li > div h3 {
font-size: 0.32rem;
margin-bottom: 10px;
}
.recommend ul li > div p {
font-size: 0.42666rem;
}
.price {
color: red;
text-align: right;
margin-top: 0.5333rem;
}
</style>newly build card Components
Using slots
The code is as follows
<template>
<div class="">
<div class="title">
<slot>
<span> Hot recommendation </span>
</slot>
</div>
</div>
</template>
<script>
export default {};
</script>
<style scoped>
.title {
text-align: center;
font-size: 0.5rem;
color: #333333;
}
.title span {
position: relative;
}
.title span::before {
content: "";
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
display: block;
background: #d4c0a7;
top: 50%;
margin-top: -4px;
left: -0.5rem;
}
.title span::after {
content: "";
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
display: block;
background: #d4c0a7;
top: 50%;
margin-top: -4px;
right: -0.5rem;
}
</style>The display effect is as follows :

边栏推荐
- Vs code setting Click to open a new file window without overwriting the previous window
- shell脚本导入存储过程到数据库
- 1553B环境搭建
- When Sqlalchemy deletes records with foreign key constraints, the foreign key constraints do not work. What is the solution?
- Analysis report on the development trend and prospect scale of silicon intermediary industry in the world and China Ⓩ 2022 ~ 2027
- The future of game guild in decentralized games
- Simple two ball loading
- Fundamentals of number theory and its code implementation
- JS discolored Lego building blocks
- PG基础篇--逻辑结构管理(触发器)
猜你喜欢

【大型电商项目开发】性能压测-压力测试基本概念&JMeter-38
Reasons for MySQL reporting 1040too many connections and Solutions

Meta enlarge again! VR new model posted on CVPR oral: read and understand voice like a human

codeforces -- 4B. Before an Exam

我选的热门专业,四年后成了“天坑”

逆向调试入门-PE结构-输入表输出表05/07

Judea pearl, Turing prize winner: 19 causal inference papers worth reading recently

学历、长相、家境普通的人,未来的发展方向是什么?00后的职业规划都已经整得明明白白......

Zabbix 6.0 源码安装以及 HA 配置

北斗通信模块 北斗gps模块 北斗通信终端DTU
随机推荐
王兴的无限游戏迎来“终极”一战
JS discolored Lego building blocks
Mysql间隙锁
Introduction to reverse debugging PE structure input table output table 05/07
有人碰到过这种情况吗,oracle logminer 同步的时候,clob字段的值丢失
从数据库中更新一条数据,用cdc会同时获得op字段分别为d和c的两条数据吗?我记得之前是只有op为u
Jenkins+webhooks- multi branch parametric construction-
Idea of [developing killer]
CS5268优势替代AG9321MCQ Typec多合一扩展坞方案
Google Earth engine (GEE) - Global Human Settlements grid data 1975-1990-2000-2014 (p2016)
CV顶会最佳论文得主分享:好论文是怎么炼成的?
R language uses conf of yardstick package_ The mat function calculates the confusion matrix of the multiclass model on each fold of each cross validation (or resampling), and uses the summary to outpu
SQLAlchemy在删除有外键约束的记录时,外键约束未起作用,何解?
Machine learning - performance metrics
Hardware development notes (9): basic process of hardware development, making a USB to RS232 module (8): create asm1117-3.3v package library and associate principle graphic devices
Asp.netcore利用dynamic简化数据库访问
Three questions about scientific entrepreneurship: timing, pain points and important decisions
PG basics -- Logical Structure Management (trigger)
Function test process in software testing
1553B environment construction