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

边栏推荐
- CS5268优势替代AG9321MCQ Typec多合一扩展坞方案
- Analysis report on the development prospect and investment strategy of the global and Chinese laser chip industry Ⓑ 2022 ~ 2027
- Look at the sky at dawn and the clouds at dusk, and enjoy the beautiful pictures
- The popular major I chose became "Tiankeng" four years later
- Analysis report on the development prospect and investment strategic planning of China's wafer manufacturing Ⓔ 2022 ~ 2028
- Quickly understand what the compressed list in redis is
- Global and Chinese silicone defoamer production and marketing demand and investment forecast analysis report Ⓨ 2022 ~ 2027
- 图灵奖得主Judea Pearl:最近值得一读的19篇因果推断论文
- VM虚拟机配置动态ip和静态ip访问
- 股票开户要认识谁?实际上网上开户安全么?
猜你喜欢

ROS2 Foxy depthai_ ROS tutorial

mysql统计账单信息(下):数据导入及查询

VM虚拟机配置动态ip和静态ip访问

不同的测试技术区分

路由基础之OSPF LSA详细讲解

香港科技大学李泽湘教授:我错了,为什么工程意识比上最好的大学都重要?

Colorful five pointed star SVG dynamic web page background JS special effect

Nexus builds NPM dependent private database

Flow management technology

How can genetic testing help patients fight disease?
随机推荐
Yarn重启applications记录恢复
股票开户要认识谁?实际上网上开户安全么?
Redis exploration: cache breakdown, cache avalanche, cache penetration
Flinkcdc should extract Oracle in real time. What should be configured for oracle?
Machine learning - performance metrics
Jenkins+webhooks-多分支参数化构建-
Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable
Analysis report on the development trend and Prospect of new ceramic materials in the world and China Ⓐ 2022 ~ 2027
Judea pearl, Turing prize winner: 19 causal inference papers worth reading recently
Asp.netcore利用dynamic简化数据库访问
逆向调试入门-PE结构-输入表输出表05/07
Localtime can't re-enter. It's a pit
终端识别技术和管理技术
王兴的无限游戏迎来“终极”一战
MySQL Replication中的并行复制示例详解
1553B environment construction
Scene function of wooden frame
flinkcdc要实时抽取oracle,对oracle要配置什么东西?
香港科技大学李泽湘教授:我错了,为什么工程意识比上最好的大学都重要?
请问flink mysql cdc 全量读取mysql某个表数据,对原始的mysql数据库有影响吗