• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import {
17  Component,
18  State,
19  Row,
20  Slider,
21  $$,
22  Checkbox,
23  Blank,
24  Text,
25} from '@kit.ArkUI';
26
27@Component
28struct MyComponent {
29  @State value: number = 0.0
30
31  build() {
32    Row() {
33      Slider({
34        value: $$(this.value)
35      })
36    }
37  }
38}
39
40@Component
41struct Test {
42  @State checked: boolean = false
43
44  build() {
45    Row() {
46      Checkbox().select($$(this.checked))
47      Blank()
48      Text(this.checked ? '开启': '关闭')
49    }
50  }
51}