From 9544034e6fa7d8be9a4efa28502a54d333762b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 25 Apr 2019 17:10:07 +0200 Subject: [PATCH] [DOC] doc: update component.md to add info on t-widget --- doc/component.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/component.md b/doc/component.md index fd3c3150..899c458e 100644 --- a/doc/component.md +++ b/doc/component.md @@ -4,6 +4,7 @@ - [Overview](#overview) - [Example](#example) +- [Templates](#templates) - [Reference](#reference) - [Properties](#properties) - [Methods](#methods) @@ -64,6 +65,23 @@ a state object is defined. It is not mandatory to use the state object, but it is certainly encouraged. The state object is [observed](observer.md), and any change to it will cause a rerendering. +## Templates + +The example above shows a QWeb template with a `t-on-click` directive. Widget +templates are standard [QWeb](qweb.md) templates, but with an extra directive: +`t-widget`. With the `t-widget` directive, widget templates can declare sub +widgets: + +```xml +
+ some text + +
+``` + +In this example, the template create a widget MyWidget just after the span. See +the [QWeb](qweb.md) documentation for more information on the `t-widget` directive. + ## Reference An Owl component is a small class which represent a widget or some UI element.