Logic
QTML supports three forms of runtime logic: if statements to choose components, conditional property values to choose one value, and for loops to repeat components. Conditions are Rust expressions and must be enclosed in parentheses.
- If statements choose which component tree to render.
- Conditional values choose a single property value.
- For loops repeat a component tree for each item in a collection.
Bindings use $, such as $user.name. Loop collections and conditions use ordinary Rust expressions, such as users and (user.is_admin).