add {subtree: "retain"} flag to allow skipping diff from app space
This commit is contained in:
parent
c4494bf2ce
commit
fcf77dfa44
12 changed files with 169 additions and 11 deletions
|
|
@ -183,7 +183,8 @@ m("a[href='/dashboard']", {config: m.route}, "Dashboard&q
|
|||
where:
|
||||
VirtualElement :: Object { String tag, Attributes attributes, Children children }
|
||||
Attributes :: Object<any | void config(DOMElement element, Boolean isInitialized)>
|
||||
Children :: String text | Array<String text | VirtualElement virtualElement | Children children></code></pre>
|
||||
Children :: String text | Array<String text | VirtualElement virtualElement | SubtreeDirective directive | Children children>
|
||||
SubtreeDirective :: Object { String subtree }</code></pre>
|
||||
<ul>
|
||||
<li><p><strong>String selector</strong></p>
|
||||
<p>This string should be a CSS rule that represents a DOM element.</p>
|
||||
|
|
@ -259,6 +260,7 @@ m("a[href='/dashboard']", {config: m.route}, "Dashboard&q
|
|||
<p>If this argument is a string, it will be rendered as a text node. To render a string as HTML, see <a href="mithril.trust"><code>m.trust</code></a></p>
|
||||
<p>If it's a VirtualElement, it will be rendered as a DOM Element.</p>
|
||||
<p>If it's a list, its contents will recursively be rendered as appropriate and appended as children of the element being created.</p>
|
||||
<p>If it's a SubtreeDirective with the value "retain", it will retain the existing DOM tree in place, if any. See <a href="mithril.render#subtree-directives">subtree directives</a> for more information.</p>
|
||||
</li>
|
||||
<li><p><strong>returns</strong> VirtualElement</p>
|
||||
<p>The returned VirtualElement is a javascript data structure that represents the DOM element to be rendered by <a href="mithril.render"><code>m.render</code></a></p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue