From 25cb75987069acce9e334e7dd98a381a7ed41504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Luba=C5=84ski?= Date: Thu, 13 Jun 2024 09:59:32 +0200 Subject: [PATCH] docs: minor fixes in structure section --- docs/component-model/structure.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/component-model/structure.md b/docs/component-model/structure.md index abf3f242..648468f8 100644 --- a/docs/component-model/structure.md +++ b/docs/component-model/structure.md @@ -159,11 +159,11 @@ value: (host) => { ... } | (host, value) => { ... } * **returns**: * a value of the property -If the descriptor `value` option is a function, the library creates a property with a getter, and optionally with a setter (if the function has more than one argument). +If the descriptor `value` option is a function, the library creates a property with a getter, and optionally with a setter (if the function has two arguments). #### Readonly -If the function has only one argument, the property will be read-only, and the function is called with the element instance: +If the function has only one argument, the property will be read-only, and the function is called with the element instance as the first argument: ```javascript define({ @@ -288,12 +288,12 @@ define({ ## Render -The `render` property is reserved for the creating structure of the custom element. - -The `value` option must be a function, which returns a result of the call to the built-in template engine. +The `render` property is reserved for the creating structure of the custom element. The `value` option must be a function, which returns a result of the call to the built-in template engine. The library uses the `observe` pattern to call the function automatically when dependencies change. As the property resolves to the update function, it can also be called manually, by `el.render()`. +If the optional `shadow` option is not used, the library determines the rendering mode based on the root template structure. If the template includes styles or `` elements, the content is rendered to the Shadow DOM. + ### Element's Content By default `render` property creates and updates the contents of the custom element: