我是靠谱客的博主 忧郁发卡,这篇文章主要介绍10.页面布局,猜你喜欢,现在分享给大家,希望可以做个参考。

新建组件like

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<template> <div class="like"> <Card> <span>猜你喜欢</span> </Card> <ul> <li v-for="(item, index) in LikeList" :key="index"> <h2><img :src="item.imgUrl" alt="" /></h2> <h3>{{ item.name }}</h3> <div class="price"> <span>$</span><b>{{ item.price }}</b> </div> </li> </ul> </div> </template> <script> import Card from "@/components/home/Card"; export default { components: { Card, }, data() { return { LikeList: [ { id: 1, name: "建开荼具套装,红色苏州市12件套", price: 68, imgUrl: "./images/n1.jpeg", }, { id: 2, name: "建开荼具套装,红色苏州市12件套", price: 68, imgUrl: "./images/n2.jpeg", }, { id: 3, name: "建开荼具套装,红色苏州市12件套", price: 68, imgUrl: "./images/n3.jpeg", }, { id: 4, name: "建开荼具套装,红色苏州市12件套", price: 68, imgUrl: "./images/n4.jpeg", }, ], }; }, }; </script> <style scoped> .like ul { display: flex; flex-wrap: wrap; } .like ul li { display: flex; flex-direction: column; /* justify-content: center; */ align-items: center; width: 50%; } .like h3 { padding: 0.16rem; width: 100%; font-size: 00.42666rem; font-weight: normal; color: #222; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .like img { width: 4.6933rem; height: 4.6933rem; } .price { width: 100%; padding-left: 0.4rem; color: red; font-size: 0.4267rem; text-align: left; margin-bottom: 0.3rem; } </style>

最后

以上就是忧郁发卡最近收集整理的关于10.页面布局,猜你喜欢的全部内容,更多相关10内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部