mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
slider_checkboxgroup
Signed-off-by: zhangjinyu101 <zhangjinyu101@huawei.com>
This commit is contained in:
parent
c199cdd8ff
commit
5576468e30
@ -49,7 +49,7 @@ export struct CheckboxGroupBootcamp {
|
||||
|
||||
Column() {
|
||||
// 全选按钮
|
||||
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
CheckboxGroup({ group: 'checkboxGroup' })
|
||||
.checkboxShape(useEnabled(this.enableCheckboxGroupShape, this.checkboxGroupShape))
|
||||
.enabled(useEnabled(this.enableCheckboxGroup, this.enable))
|
||||
@ -61,8 +61,9 @@ export struct CheckboxGroupBootcamp {
|
||||
}
|
||||
|
||||
// 选项1
|
||||
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
|
||||
.shape(useEnabled(this.enableCheckboxGroupShape, this.checkboxGroupShape))
|
||||
.select(true)
|
||||
.onChange((value: boolean) => {
|
||||
console.info(`Checkbox1 change is ${value}`)
|
||||
@ -71,8 +72,9 @@ export struct CheckboxGroupBootcamp {
|
||||
}
|
||||
|
||||
// 选项2
|
||||
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
|
||||
.shape(useEnabled(this.enableCheckboxGroupShape, this.checkboxGroupShape))
|
||||
.onChange((value: boolean) => {
|
||||
console.info(`Checkbox2 change is ${value}`)
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { RadioBlock, useEnabled } from 'common';
|
||||
import { RadioBlock, useEnabled, SliderBlock } from 'common';
|
||||
import { Drawer } from 'common/src/main/ets/components/Drawer';
|
||||
|
||||
@Component
|
||||
@ -24,6 +24,8 @@ export struct SliderBootcamp {
|
||||
@State sliderStyle: SliderStyle = SliderStyle.OutSet;
|
||||
@State enableShowSteps: boolean = false;
|
||||
@State showSteps: boolean = false;
|
||||
@State enableStep: boolean = false;
|
||||
@State step: number = 1;
|
||||
@State enableShowTips: boolean = false;
|
||||
@State showTips: boolean = false;
|
||||
@State enableDirection: boolean = false;
|
||||
@ -49,7 +51,7 @@ export struct SliderBootcamp {
|
||||
@Builder
|
||||
Content() {
|
||||
Column({ space: 8 }) {
|
||||
Slider({ style: useEnabled(this.enableSliderStyle, this.sliderStyle) })
|
||||
Slider({ style: useEnabled(this.enableSliderStyle, this.sliderStyle), step: this.step })
|
||||
.showTips(useEnabled(this.enableShowTips, this.showTips))
|
||||
.showSteps(useEnabled(this.enableShowSteps, this.showSteps))
|
||||
.direction(useEnabled(this.enableDirection, this.currentDirection))
|
||||
@ -80,6 +82,14 @@ export struct SliderBootcamp {
|
||||
]
|
||||
})
|
||||
|
||||
SliderBlock({
|
||||
title: '间续滑动步长',
|
||||
isEnabled: this.enableStep,
|
||||
value: this.step,
|
||||
min: 1,
|
||||
max: 20
|
||||
})
|
||||
|
||||
RadioBlock({
|
||||
title: '是否显示气泡',
|
||||
isEnabled: this.enableShowTips,
|
||||
|
Loading…
Reference in New Issue
Block a user