当前位置:网站首页>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 :

边栏推荐
- MySQL报错1040Too many connections的原因以及解决方案
- The future of game guild in decentralized games
- Cs5268 advantages replace ag9321mcq typec multi in one docking station scheme
- 5G工业网关的科技治超应用 超限超重超速非现场联合执法
- Vs code set code auto save
- 逆向调试入门-PE结构-输入表输出表05/07
- Introduction to reverse debugging PE structure input table output table 05/07
- Class initialization and instantiation
- Declare an abstract class vehicle, which contains the private variable numofwheel and the public functions vehicle (int), horn (), setnumofwheel (int) and getnumofwheel (). Subclass mot
- 我选的热门专业,四年后成了“天坑”
猜你喜欢

Terminal identification technology and management technology

shell脚本导入存储过程到数据库

我花上万学带货:3天赚3元,成交靠刷单

软件测试中功能测试流程

La taille de la pile spécifiée est petite, spécifiée à la sortie 328k

codeforces -- 4B. Before an Exam
![[Niu Ke's questions -sql big factory interview real questions] no2 User growth scenario (a certain degree of information flow)](/img/a0/e9e7506c9c34986dc73562539c8410.png)
[Niu Ke's questions -sql big factory interview real questions] no2 User growth scenario (a certain degree of information flow)

Function test process in software testing

数据库之MHA高可用集群部署及故障切换

Application of 5g industrial gateway in scientific and technological overload control; off-site joint law enforcement for over limit, overweight and overspeed
随机推荐
Project deployment is not difficult at all!
How to count the status of network sockets?
Declare an abstract class vehicle, which contains the private variable numofwheel and the public functions vehicle (int), horn (), setnumofwheel (int) and getnumofwheel (). Subclass mot
Machine learning - performance metrics
Report on the "14th five year plan" and scale prospect prediction of China's laser processing equipment manufacturing industry Ⓢ 2022 ~ 2028
Feign & Eureka & Zuul & Hystrix 流程
Has anyone ever encountered this situation? When Oracle logminer is synchronized, the value of CLOB field is lost
Use of shutter SQLite
图灵奖得主Judea Pearl:最近值得一读的19篇因果推断论文
Router.use() requires a middleware function but got a Object
商汤科技崩盘 :IPO时已写好的剧本
VM virtual machine configuration dynamic IP and static IP access
oracle cdc 数据传输时,clob类型字段,在update时值会丢失,update前有值,但
Operator-1 first acquaintance with operator
Global and Chinese styrene acrylic lotion polymer development trend and prospect scale prediction report Ⓒ 2022 ~ 2028
There are still many things to be done in the second half of the year
彩色五角星SVG动态网页背景js特效
声明一个抽象类Vehicle,它包含私有变量numOfWheels和公共函数Vehicle(int)、Horn()、setNumOfWheels(int)和getNumOfWheels()。子类Mot
Update a piece of data from the database. Will CDC get two pieces of data with OP fields D and C at the same time? I remember before, only OP was U
There are risks in trading