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

边栏推荐
- The 14th five year plan of China's environmental protection industry and the report on the long-term goals for 2035 Ⓖ 2022 ~ 2028
- Research Report on China's software outsourcing industry investment strategy and the 14th five year plan Ⓡ 2022 ~ 2028
- Scene function of wooden frame
- Use of shutter SQLite
- MySQL gap lock
- 股票开户要认识谁?实际上网上开户安全么?
- How to count the status of network sockets?
- [Niu Ke's questions -sql big factory interview real questions] no2 User growth scenario (a certain degree of information flow)
- MySQL statistical bill information (Part 2): data import and query
- Redis exploration: cache breakdown, cache avalanche, cache penetration
猜你喜欢

Operator-1 first acquaintance with operator

A Fletter version of Notepad

Jenkins+webhooks-多分支参数化构建-

Manage nodejs with NVM (downgrade the high version to the low version)

Redis explores cache consistency

彩色五角星SVG动态网页背景js特效

What is the future development direction of people with ordinary education, appearance and family background? The career planning after 00 has been made clear

图灵奖得主Judea Pearl:最近值得一读的19篇因果推断论文
Example code of second kill based on MySQL optimistic lock

Google Earth Engine(GEE)——全球人类居住区网格数据 1975-1990-2000-2014 (P2016)
随机推荐
彩色五角星SVG动态网页背景js特效
【大型电商项目开发】性能压测-压力测试基本概念&JMeter-38
There are still many things to be done in the second half of the year
PG基础篇--逻辑结构管理(触发器)
leetcode 322. Coin change (medium)
啟動solr報錯The stack size specified is too small,Specify at least 328k
codeforces -- 4B. Before an Exam
逆向调试入门-PE结构-输入表输出表05/07
1553B环境搭建
Router. use() requires a middleware function but got a Object
VM虚拟机配置动态ip和静态ip访问
SQLAlchemy在删除有外键约束的记录时,外键约束未起作用,何解?
Content Audit Technology
Google Earth Engine(GEE)——全球人类居住区网格数据 1975-1990-2000-2014 (P2016)
Localtime can't re-enter. It's a pit
There are risks in trading
学历、长相、家境普通的人,未来的发展方向是什么?00后的职业规划都已经整得明明白白......
Global and Chinese styrene acrylic lotion polymer development trend and prospect scale prediction report Ⓒ 2022 ~ 2028
flinkcdc要实时抽取oracle,对oracle要配置什么东西?
Wave animation color five pointed star loader loading JS special effects