当前位置:网站首页>Harmonyos third operation
Harmonyos third operation
2022-07-27 23:03:00 【Dandelion650】
1、 Establishment of homepage , Cite three examples



2、 The implementation of three example windows
For the first example ( Rotation plot ):
css Code :
.cb-swiper-container {
height: 240px;
}
swiper {
width: 100%;
}
image {
width: 100%;
height: 100%;
object-fit: fill;
}hml Code :
<div class="cb-swiper-container">
<swiper>
<image for="{
{list.slice(0,5)}}"src="{
{$item.img}}"></image>
</swiper>
</div>js Code :
export default{
props:{
list:{
type:Array
}
},
onReady(){
console.log(this.list);
}
}Second example ( Hot categories ):
css:
.cb-hc-container {
flex-direction: column;
}
.cb-hc-title {
border-bottom-width: 0.5px;
border-bottom-color: #eee;
height: 44px;
}
text {
font-size: 12px;
padding-left: 10px;
}
.cb-hc-list {
flex-wrap: wrap;
margin-top: 20px;
}
.cb-hc-item {
width: 33.33333%;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
image {
object-fit: cover;
width: 70px;
height: 70px;
border-radius: 8px;
}
text {
font-size: 14px;
line-height: 30px;
}hml:
<div class="cb-hc-container">
<div class="cb-hc-title">
<text>
Hot categories
</text>
</div>
<div class="cb-hc-list">
<div class="cb-hc-item" for="{
{list}}">
<image src="{
{$item.img}}"></image>
<text>{
{$item.title}}</text>
</div>
</div>
</div>、js:
// @ts-nocheck
import list from '../../../common/data/cookbook-hotcat.json'
export default{
data:{
list:[]
},
onReady(){
this.list = list
}
}The third example ( Fine dishes ):

css:
}
text {
font-size: 12px;
}
.cb-top-body {
flex-wrap: wrap;
padding-left: 10px;
padding-right: 10px;
}
.cb-top-item {
width: 50%;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: white;
padding-bottom: 15px;
margin-bottom: 10px;
height: 160px;
}
image {
width: 100%;
flex: 1;
object-fit: contain;
}
.cb-top-item-info {
height: 50px;
flex-direction: column;
align-items: center;
}
.cb-top-item-title {
font-size: 16px;
}
.cb-top-item-subtitle {
font-size: 12px;
color: #666;
font-weight: 100;
}
hml :<div class="cb-top-container">
<div class="cb-top-title">
<text>
Fine dishes
</text>
</div>
<div class="cb-top-body">
<div class="cb-top-item" for="{
{list.slice(0,10)}}">
<image src="{
{$item.img}}"></image>
<div class="cb-top-item-info">
<text class="cb-top-item-title">
{
{$item.name}}
</text>
<text class="cb-top-item-subtitle">
{
{$item.all_click}} Browse {
{$item.favorites}} Collection
</text>
</div>
</div>
</div>
</div>js:
export default{
props:{
list:{
type:Array
}
}
}边栏推荐
- It is said that Huawei will cut the order again! Supply chain manufacturers are more difficult
- 干货|语义网、Web3.0、Web3、元宇宙这些概念还傻傻分不清楚?(中)
- PyQt5快速开发与实战 4.9 对话框类控件
- 美国官员建议特朗普阻止英飞凌收购赛普拉斯
- 一篇搞定Redis中的BigKey问题
- Parameter transmission of components
- 云计算服务主要安全风险及应对措施
- Quartus:Instantiation of ‘sdram_ model_ plus‘ failed. The design unit was not found.
- Tips and extensions of graph theory
- 对象创建过程及对象布局
猜你喜欢

Parameter transmission of components

Do you want to be dismissed? Let's take a look at the "exit tips" of programmers

The follow-up is coming. Whether it's OK without reference, let's make it clear to everyone at once!

SparkSQL的UDF及分析案例,220726,,

In depth analysis - file operation

Leetcode-461. Hamming distance

Fluorescence imaging of cle19 polypeptide in cells preparation of fluorescence quenching quantum dots of bovine serum albumin

浅谈数仓的数据治理

深度剖析 —— 文件操作

Preparation of peptide kc2s modified albumin nanoparticles / targeting peptide GX1 modified human serum albumin nanoparticles probe
随机推荐
Data warehouse project is never a technical project
追源码的平凡之路
Motorola v. hytera: hytera was awarded 5.3 billion yuan
ADI, Shijian and Junlong technology jointly donated 2.3 million yuan to help fight the epidemic in Hubei
8000 word explanation of OBSA principle and application practice
2022/6/5考试总结
Shandong football match
You don't know about redis. Let me explain the underlying data structure of redis in detail
美国疫情扩散到28个州:苹果、微软等10多万员工在家办公,iPhone11快断货了!
摩托罗拉诉海能达案一审结果出炉:海能达被判赔53亿元
Bubbling, fast sorting, heap sorting and cardinality sorting of the eight sorts
格力口罩来了!KN95口罩只要5.5元一个!
leetcode-461.汉明距离
[cloud native] deploy redis cluster in k8s
数据仓库项目从来不是技术项目
ADI、世健、骏龙科技共同捐赠230万元助力湖北抗疫
It is said that Huawei will cut the order again! Supply chain manufacturers are more difficult
2022/5/17考试总结
物联网架构完全指南
TFRecord的Shuffle、划分和读取