• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import { ColorBlock, RadioBlock, SliderBlock } from 'common';
2
3
4@Component
5export struct CompOutlineBlocks {
6  @Link enableCompOutlineValueWidth: boolean;
7  @Link compOutlineValueWidth: number;
8  @Link enableCompOutlineValueColor: boolean;
9  @Link compOutlineValueColor: ResourceColor;
10  @Link enableCompOutlineValueRadius: boolean;
11  @Link compOutlineValueRadius: number;
12  @Link enableCompOutlineValueStyle: boolean;
13  @Link compOutlineValueStyle: OutlineStyle;
14
15  build() {
16    Column() {
17      SliderBlock({
18        title: 'outline.value.width',
19        isEnabled: $enableCompOutlineValueWidth,
20        value: $compOutlineValueWidth,
21        min: 0,
22        max: 32
23      })
24      if (this.enableCompOutlineValueWidth) {
25        ColorBlock({
26          title: 'outline.value.color',
27          isEnabled: $enableCompOutlineValueColor,
28          color: $compOutlineValueColor
29        })
30        SliderBlock({
31          title: 'outline.value.radius',
32          isEnabled: $enableCompOutlineValueRadius,
33          value: $compOutlineValueRadius,
34          min: 0,
35          max: 32
36        })
37        RadioBlock({
38          title: 'outline.value.style',
39          isEnabled: $enableCompOutlineValueStyle,
40          value: $compOutlineValueStyle,
41          dataSource: [
42            { label: 'SOLID', value: OutlineStyle.SOLID },
43            { label: 'DASHED', value: OutlineStyle.DASHED },
44            { label: 'DOTTED', value: OutlineStyle.DOTTED },
45          ]
46        })
47      }
48    }
49  }
50}