当前位置:网站首页>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
}
}
}边栏推荐
- 2022/6/9 考试总结
- Zhihu data analysis training camp all-round class
- 图论的小技巧以及扩展
- 2022/4/8考试总结
- Trends in software development in 2022
- catch all in one draft! Introduction to 10 data visualization software
- Bubbling, fast sorting, heap sorting and cardinality sorting of the eight sorts
- 51单片机内部外设:实时时钟(SPI)
- 浅析云原生应用安全组织架构
- 只会Excel想做图表可视化,让数据动起来?可以,快来围观啦(附大量模板下载)
猜你喜欢

Trends in software development in 2022

Buuctf brushes eleven questions (05)

JVM composition and memory model

If there is no reference ground at all, guess if you can control the impedance?

PyQt5快速开发与实战 4.9 对话框类控件

Dry goods semantic web, Web3.0, Web3, metauniverse, these concepts are still confused? (medium)

视频人体行为检测

解决ip地址访问末位奇数通偶数不通,或者偶数通奇数不通的问题(云加密机连接云服务器时遇到的问题,全程记录,希望能给大佬们灵感)

深度剖析 —— 文件操作
![The wave of smart home is coming, how to make machines understand the world [there is information at the end]](/img/8a/533e7f1fc96c03e6f8140efdd17983.png)
The wave of smart home is coming, how to make machines understand the world [there is information at the end]
随机推荐
[noi2018] return (Kruskal reconstruction tree / persistent and search set)
传华为再度砍单!供应链厂商更难了
2022/5/18 考试总结
20字符短域名绕过复现
Six employees have been confirmed! Samsung closed the turtle tail mobile phone factory for the third time!
OPPO Find X2系列发布:3K+120Hz曲面屏,DXO评分第一,顶配版6999元!
组件的传参
Leetcode-461. Hamming distance
Oppo find x2 series release: 3k+120hz curved screen, DxO score first, top version 6999 yuan!
对象创建过程及对象布局
Solve the problem that the last bit of IP address access is odd and even, or even and odd (the problem encountered when the cloud encryption machine connects to the cloud server, the whole process is
Complete Guide to IOT architecture
只会Excel想做图表可视化,让数据动起来?可以,快来围观啦(附大量模板下载)
Arm32进行远程调试
Do you want to be dismissed? Let's take a look at the "exit tips" of programmers
The prefix is not removed when zuul gateway automatically routes
It is said that Huawei will cut the order again! Supply chain manufacturers are more difficult
Redis网红高频面试题三连:缓存穿透?缓存击穿?缓存雪崩?
摩托罗拉诉海能达案一审结果出炉:海能达被判赔53亿元
浅析云原生应用安全组织架构