提交 3f06f8dc 编写于 作者: S sienna1128

update docs

Signed-off-by: Nsienna1128 <lixiaoyan45@huawei.com>
上级 061b334b
......@@ -22,7 +22,7 @@
@Entry
@Component
struct AspectRatioExample {
private children: string[] = ['1', '2', '3', '4', '5', '6']
private children: string[] = ['1', '2', '3', '4', '5', '6'];
build() {
Column({ space: 20 }) {
......@@ -77,13 +77,13 @@ struct AspectRatioExample {
```ts
class ContainerInfo {
label: string = ''
size: string = ''
label: string = '';
size: string = '';
}
class ChildInfo {
text: string = ''
priority: number = 0
text: string = '';
priority: number = 0;
}
@Entry
......@@ -102,14 +102,14 @@ struct DisplayPriorityExample {
{ text: '4\n(priority:1)', priority: 1 },
{ text: '5\n(priority:2)', priority: 2 }
]
@State currentIndex: number = 0
@State currentIndex: number = 0;
build() {
Column({ space: 10 }) {
// 切换父级容器大小
Button(this.container[this.currentIndex].label).backgroundColor(0x317aff)
.onClick(() => {
this.currentIndex = (this.currentIndex + 1) % this.container.length
this.currentIndex = (this.currentIndex + 1) % this.container.length;
})
// 通过变量设置Flex父容器宽度
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册