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

update docs

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