未验证 提交 16bf002c 编写于 作者: O openharmony_ci 提交者: Gitee

!7716 【轻量级 PR】:update...

!7716 【轻量级 PR】:update zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md.修改代码格式
Merge pull request !7716 from 李毅/N/A
...@@ -53,45 +53,47 @@ CheckboxGroup( group?: string ) ...@@ -53,45 +53,47 @@ CheckboxGroup( group?: string )
@Entry @Entry
@Component @Component
struct CheckboxExample { struct CheckboxExample {
build() { build() {
Scroll() { Scroll() {
Column() { Column() {
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }){ Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
CheckboxGroup({group : 'checkboxGroup'}) CheckboxGroup({ group: 'checkboxGroup' })
.selectedColor(0xed6f21) .selectedColor(0xed6f21)
.onChange((itemName:CheckboxGroupResult) => { .onChange((itemName: CheckboxGroupResult) => {
console.info("TextPicker::dialogResult is" + JSON.stringify(itemName)) console.info("TextPicker::dialogResult is" + JSON.stringify(itemName))
}) })
Text('select all').fontSize(20) Text('select all').fontSize(20)
} }
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }){
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
.select(true) Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.selectedColor(0x39a2db) .select(true)
.onChange((value: boolean) => { .selectedColor(0x39a2db)
console.info('Checkbox1 change is' + value) .onChange((value: boolean) => {
}) console.info('Checkbox1 change is' + value)
Text('Checkbox1').fontSize(20) })
} Text('Checkbox1').fontSize(20)
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }){ }
Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
.select(false) Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
.selectedColor(0x39a2db) Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
.onChange((value: boolean) => { .select(false)
console.info('Checkbox2 change is' + value) .selectedColor(0x39a2db)
}) .onChange((value: boolean) => {
Text('Checkbox2').fontSize(20) console.info('Checkbox2 change is' + value)
} })
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }){ Text('Checkbox2').fontSize(20)
Checkbox({ name: 'checkbox3', group: 'checkboxGroup' }) }
.select(true)
.selectedColor(0x39a2db) Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
.onChange((value: boolean) => { Checkbox({ name: 'checkbox3', group: 'checkboxGroup' })
console.info('Checkbox3 change is' + value) .select(true)
}) .selectedColor(0x39a2db)
Text('Checkbox3').fontSize(20) .onChange((value: boolean) => {
} console.info('Checkbox3 change is' + value)
})
Text('Checkbox3').fontSize(20)
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册