1{ 2 "name": "button", 3 "version": [ 4 { 5 "name": "v3.0" 6 } 7 ], 8 "description": [ 9 { 10 "name": "The <button> component includes capsule, circle, text, arc, and download buttons." 11 } 12 ], 13 "attributes": [ 14 { 15 "name": "type", 16 "required": false, 17 "description": [ 18 { 19 "name": "Dynamic modification is not supported. If this attribute is not set, capsule-like buttons are displayed. Different from the capsule button, the four rounded corners of a capsule-like button can be configured using border-radius. Available button types are as follows: capsule: a capsule button with fillets, background color, and text. circle: a circle button which can be used to place icons. text: a text button which displays the text only. arc: an arc button. download: a download button. The download progress bar is added." 20 } 21 ], 22 "type": "enum", 23 "options": [ 24 { 25 "name": "capsule" 26 }, 27 { 28 "name": "circle" 29 }, 30 { 31 "name": "text" 32 } 33 ] 34 }, 35 { 36 "name": "value", 37 "required": false, 38 "description": [ 39 { 40 "name": "Text value of the button. This attribute is unavailable for circle buttons." 41 } 42 ], 43 "type": "string" 44 }, 45 { 46 "name": "icon", 47 "required": false, 48 "description": [ 49 { 50 "name": "Path of the button icon. This parameter is valid only for the circle button. The supported icon formatformats are JPG, PNG, and SVG." 51 } 52 ], 53 "type": "url" 54 }, 55 { 56 "name": "placement", 57 "required": false, 58 "description": [ 59 { 60 "name": "Position of the button icon in text. This attribute is valid only when type is not set. Available values are as follows: start: The button icon is at the beginning of the text. end: The button icon is at the end of the text. top: The button icon is at the top of the text.bottom: The button icon is at the bottom of the text." 61 } 62 ], 63 "type": "enum", 64 "options": [ 65 { 66 "name": "end" 67 }, 68 { 69 "name": "start" 70 }, 71 { 72 "name": "top" 73 }, 74 { 75 "name": "bottom" 76 } 77 ] 78 }, 79 { 80 "name": "waiting", 81 "required": false, 82 "description": [ 83 { 84 "name": "Waiting status. When waiting is set to true, the waiting transition is displayed on the left of the text. This attribute is unavailable for download buttons and smart watches." 85 } 86 ], 87 "type": "enum", 88 "options": [ 89 { 90 "name": "true" 91 }, 92 { 93 "name": "false" 94 } 95 ] 96 }, 97 { 98 "name": "id", 99 "required": false, 100 "description": [ 101 { 102 "name": "Unique ID of a component." 103 } 104 ], 105 "type": "string" 106 }, 107 { 108 "name": "style", 109 "required": false, 110 "description": [ 111 { 112 "name": "Style declaration of a component." 113 } 114 ], 115 "type": "string" 116 }, 117 { 118 "name": "class", 119 "required": false, 120 "description": [ 121 { 122 "name": "Style class of a component, which is used to refer to a style table." 123 } 124 ], 125 "type": "string" 126 }, 127 { 128 "name": "disabled", 129 "required": false, 130 "description": [ 131 { 132 "name": "Whether the component is disabled. If the component is disabled, the component cannot respond to user interaction." 133 } 134 ], 135 "type": "enum", 136 "options": [ 137 { 138 "name": "true" 139 }, 140 { 141 "name": "false" 142 } 143 ] 144 }, 145 { 146 "name": "voicelabel", 147 "required": false, 148 "description": [ 149 { 150 "name": "Voice label. When a voice label is triggered, the click event of the component is triggered. NOTE: The voice label takes effect only when the click event is set." 151 } 152 ], 153 "type": "string" 154 }, 155 { 156 "name": "subscriptflag", 157 "required": false, 158 "description": [ 159 { 160 "name": "Voice subscript switch. Available values are as follows: auto: For the <image> and <list-item> components, if subscriptflag is set to auto, the voice subscript is turned on. For other components, if subscriptflag is set to auto, the voice subscript is turned off. on: Turn on the voice subscript. off: Turn off the voice subscript. If no customized subscript is set, the subscript is automatically accumulated from 1. NOTE The voice subscript takes effect only when the click event is set." 161 } 162 ], 163 "type": "enum", 164 "options": [ 165 { 166 "name": "auto" 167 }, 168 { 169 "name": "on" 170 }, 171 { 172 "name": "off" 173 } 174 ] 175 }, 176 { 177 "name": "subscriptlabel", 178 "required": false, 179 "description": [ 180 { 181 "name": "Custom subscript. After it is set, the subscript is displayed in the way you specified. To make this attribute take effect, you need to turn on the voice subscript." 182 } 183 ], 184 "type": "string" 185 }, 186 { 187 "name": "scenelabel", 188 "required": false, 189 "description": [ 190 { 191 "name": "Available values are as follows: video: Video scenario. For example, to watch a video, a user can say the voiceLabel (usually the video name), play voiceLabel, see voiceLabel, or watch voiceLabel, etc. audio: Music scenario. For example, to listen to a song, a user can say the voiceLabel (usually the song name), play voiceLabel, or listen voiceLabel, etc. page: Page scenario. For example, to go to a page, a user can say the voiceLabel (usually the page name), switch to voiceLabel, go to voiceLabel, or jump to voiceLabel, etc. switch: Switch scenario. For example, to turn on or turn off a switch, a user can say the voiceLabel (usually the switch name), turn on voiceLabel, open voiceLabel, turn off voiceLabel, close voiceLabel, etc. common: Common scenario, which is triggered by the voiceLabel." 192 } 193 ], 194 "type": "enum", 195 "options": [ 196 { 197 "name": "video" 198 }, 199 { 200 "name": "audio" 201 }, 202 { 203 "name": "page" 204 }, 205 { 206 "name": "switch" 207 }, 208 { 209 "name": "common" 210 } 211 ] 212 }, 213 { 214 "name": "accessibilitygroup", 215 "required": false, 216 "description": [ 217 { 218 "name": "Accessibility group. If this attribute is set to true, the component and all its child components form an entire selectable component, and the accessibility service will no longer available for the content of its child components." 219 } 220 ], 221 "type": "enum", 222 "options": [ 223 { 224 "name": "true" 225 }, 226 { 227 "name": "false" 228 } 229 ] 230 }, 231 { 232 "name": "accessibilitytext", 233 "required": false, 234 "description": [ 235 { 236 "name": "Accessibility text. If a component does not contain text information, it will not be read when the component is selected by the screen reader. In this case, the screen reader user cannot know which component is selected. To solve this problem, you can set this attribute for components without text information. When the component is selected by the screen reader, the specified accessibility text will be read, informing the user which component is selected. If a component with this attribute set contains text information, only the accessibility text will be read." 237 } 238 ], 239 "type": "string" 240 }, 241 { 242 "name": "accessibilitydescription", 243 "required": false, 244 "description": [ 245 { 246 "name": "Accessibility description. You can specify further explanation of the current component, for example, possible operation consequences, especially those cannot be learned from component attributes and accessibility text. You can set a detailed description text for the attribute of the component to help users understand the operation to be performed. If a component contains both text information and the accessibility description, the text is read first and then the accessibility description, when the component is selected." 247 } 248 ], 249 "type": "string" 250 }, 251 { 252 "name": "accessibilityimportance", 253 "required": false, 254 "description": [ 255 { 256 "name": "Accessibility importance, which is used to decide whether a component can be identified by the accessibility service. The value can be auto, yes, no, or no-hide-descendants. The last value forces the screen reader to ignore the current component and all its subcomponents. yes: The current component is selectable for the accessibility service. no: The current component is not selectable for the accessibility service." 257 } 258 ], 259 "type": "string" 260 }, 261 { 262 "name": "for", 263 "required": false, 264 "description": [ 265 { 266 "name": "Expands the current element based on the configured data list." 267 } 268 ], 269 "type": "string" 270 }, 271 { 272 "name": "tid", 273 "required": false, 274 "description": [ 275 { 276 "name": "The tid attribute is used to accelerate the for loop. It is used to improve the re-rendering efficiency when data in a loop changes. The tid attribute specifies the unique ID of each element in the array. If it is not specified, the index of each element in the array is used as the ID. For example, tid='id' indicates that the id attribute of each element is its unique identifier." 277 } 278 ], 279 "type": "string" 280 }, 281 { 282 "name": "if", 283 "required": false, 284 "description": [ 285 { 286 "name": "Whether the element is added or removed." 287 } 288 ], 289 "type": "enum", 290 "options": [ 291 { 292 "name": "true" 293 }, 294 { 295 "name": "false" 296 } 297 ] 298 }, 299 { 300 "name": "elif", 301 "required": false, 302 "description": [], 303 "type": "enum", 304 "options": [ 305 { 306 "name": "true" 307 }, 308 { 309 "name": "false" 310 } 311 ] 312 }, 313 { 314 "name": "else", 315 "required": false, 316 "description": [], 317 "type": "string" 318 }, 319 { 320 "name": "show", 321 "required": false, 322 "description": [ 323 { 324 "name": "Whether the element is displayed or hidden." 325 } 326 ], 327 "type": "enum", 328 "options": [ 329 { 330 "name": "true" 331 }, 332 { 333 "name": "false" 334 } 335 ] 336 } 337 ], 338 "events": [ 339 { 340 "name": "click", 341 "description": [ 342 { 343 "name": "Triggered when a component is clicked." 344 } 345 ] 346 } 347 ], 348 "supportedSubComponents": false, 349 "supportedSubComponentsRestriction": [], 350 "unSupportSubComponentsRestriction": [], 351 "parentComponentsRestriction": [] 352} 353