Building Pages: Add `config` property to access widget configuration (#2013)

Reference #1698.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
pull/2016/head
Florian Hotze 2023-02-25 12:18:13 +01:00 committed by GitHub
parent 8ba401fba0
commit cc9bc0fbd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -149,6 +149,7 @@ Expressions are string literals beginning with the symbol `=` and everything aft
- `items` is a dynamic key/value dictionary allowing you to retrieve the state of items; the result of `items.Item1` will be an object like `{ state: '23', displayState: '23 °C' }` (`displayState` may be omitted). You can therefore use `items.Item1.state` to use the current state of Item1 in your expression, if it changes, it will be reevaluated
- `props` is a dictionary of the key/values of self-defined props for the current personal widget, or page (pages, like any root UI components, may indeed have props). It is indispensable to use props in expressions when developing a personal widget
- `config` is a dictionary of the key/values of the configuration of the current component/widget
- `vars` is a dictionary of variables (see below) that are available in the component's context
- `loop` is a dictionary containing iteration information when you're repeating components from a source collection, it is defined only when in the context of a `oh-repeater` component
- the JavaScript `Math` object (so you can use `Math.floor(...)`, `Math.round(...)` and the like)