赞
踩
@Builder
function
@Builder function 函数名(){ }
@Builder function ItemCard(item: Item){ Row({space: 10}){ Image(item.image) .width(100) Column({space: 4}){ ... } .height('100%') .alignItems(HorizontalAlign.Start) } .width('100%') .backgroundColor('#FFF') .borderRadius(20) .height(120) .padding(10) }
函数名()
List({space: 8}){
ForEach(
this.items,
(item: Item) => {
ListItem(){
ItemCard(item)
}
}
)
}
function
@Builder 函数名(){ }
@Builder ItemCard(item: Item){ Row({space: 10}){ Image(item.image) .width(100) Column({space: 4}){ ... } .height('100%') .alignItems(HorizontalAlign.Start) } .width('100%') .backgroundColor('#FFF') .borderRadius(20) .height(120) .padding(10) }
this.函数名()
List({space: 8}){
ForEach(
this.items,
(item: Item) => {
ListItem(){
this.ItemCard(item)
}
}
)
}
function
@Styles function 函数名((){ }
@Styles function fillScreen(){
.width('100%')
.height('100%')
.backgroundColor('#EFEFEF')
.padding(20)
}
.函数名()
Column({ space: 8 }) {
...
}
.fillScreen()
function
@Styles 函数名((){ }
@Styles fillScreen(){
.width('100%')
.height('100%')
.backgroundColor('#EFEFEF')
.padding(20)
}
.函数名()
Column({ space: 8 }) {
...
}
.fillScreen()
@Extend(组件名) function 函数名() {
@Extend(Text) function priceText() {
.fontColor('#F36')
.fontSize(18)
}
.函数名()
Text('补贴:¥' + item.discount)
.priceText()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。