From 46e05f1c964f15b25f6f00b23ee91290cd0de928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 29 Apr 2019 14:15:19 +0200 Subject: [PATCH] [DOC] qweb: add some documentation --- doc/qweb.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/qweb.md b/doc/qweb.md index 1c0489cb..49453fa0 100644 --- a/doc/qweb.md +++ b/doc/qweb.md @@ -10,6 +10,7 @@ - [`t-set` directive](#t-set-directive) - [`t-if` directive](#t-if-directive) - [Expression evaluation](#expression-evaluation) + - [t-att directive (dynamic attributes)](#t-att-directive-dynamic-attributes) - [JS/OWL Specific Extensions](#jsowl-specific-extensions) - [t-on directive](#t-on-directive) - [Component: t-widget, t-props](#component-t-widget-t-props) @@ -208,8 +209,20 @@ compile time. ### `t-att` directive (dynamic attributes) -todo +One can use the `t-att-` directive to add dynamic attributes. Its main use is to +evaluate an expression (at rendering time) and bind an attribute to its result: +For example, if we have `id` set to 32 in the rendering context, + +```xml +
+``` + +If an expression evaluates to a falsy value, it will not be set at all: + +```xml +
+``` ## JS/OWL Specific Extensions