fixing links
This commit is contained in:
parent
2161e0ef25
commit
c736e738ce
211 changed files with 2776 additions and 1876 deletions
|
|
@ -60,7 +60,7 @@
|
|||
</div>
|
||||
<div class="col(9,9,12)">
|
||||
<h2 id="m">m</h2>
|
||||
<p>This is a convenience method to compose virtual elements that can be rendered via <a href="mithril.render"><code>m.render()</code></a>.</p>
|
||||
<p>This is a convenience method to compose virtual elements that can be rendered via <a href="mithril.render.html"><code>m.render()</code></a>.</p>
|
||||
<p>You are encouraged to use CSS selectors to define virtual elements. See "Signature" section for details.</p>
|
||||
<hr>
|
||||
<h3 id="usage">Usage</h3>
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
m("div", "Hello"); //yields <div>Hello</div>
|
||||
|
||||
m("div", {class: "container"}, "Hello"); //yields <div class="container">Hello</div></code></pre>
|
||||
<p>Note that the output value from <code>m()</code> is not an actual DOM element. In order to turn the virtual element into a real DOM element, you must call <a href="mithril.render"><code>m.render()</code></a>.</p>
|
||||
<p>Note that the output value from <code>m()</code> is not an actual DOM element. In order to turn the virtual element into a real DOM element, you must call <a href="mithril.render.html"><code>m.render()</code></a>.</p>
|
||||
<pre><code class="lang-javascript">m.render(document.body, m("br")); //puts a <br> in <body></code></pre>
|
||||
<p>You can also use more complex CSS selectors:</p>
|
||||
<pre><code class="lang-javascript">m(".container"); //yields <div class="container"></div>
|
||||
|
|
@ -165,7 +165,7 @@ m.render(document.body, view);
|
|||
|
||||
//here, isInitialized is `true`
|
||||
m.render(document.body, view);</code></pre>
|
||||
<p>One common way of using <code>config</code> is in conjunction with <a href="mithril.route"><code>m.route</code></a>, which is an unobtrusive extension to links that allow Mithril's routing system to work transparently regardless of which routing mode is used.</p>
|
||||
<p>One common way of using <code>config</code> is in conjunction with <a href="mithril.route.html"><code>m.route</code></a>, which is an unobtrusive extension to links that allow Mithril's routing system to work transparently regardless of which routing mode is used.</p>
|
||||
<pre><code class="lang-javascript">//this link can use any of Mithril's routing system modes
|
||||
//(i.e. it can use either the hash, the querystring or the pathname as the router implementation)
|
||||
//without needing to hard-code any syntax (`#` or `?`) in the `href` attribute.
|
||||
|
|
@ -236,7 +236,7 @@ m.render(document.body, view);
|
|||
|
||||
//here, isInitialized is `true`
|
||||
m.render(document.body, view);</code></pre>
|
||||
<p>One common way of using <code>config</code> is in conjunction with <a href="mithril.route"><code>m.route</code></a>, which is an unobtrusive extension to links that allow Mithril's routing system to work transparently regardless of which routing mode is used.</p>
|
||||
<p>One common way of using <code>config</code> is in conjunction with <a href="mithril.route.html"><code>m.route</code></a>, which is an unobtrusive extension to links that allow Mithril's routing system to work transparently regardless of which routing mode is used.</p>
|
||||
<pre><code class="lang-javascript">//this link can use any of Mithril's routing system modes
|
||||
//(i.e. it can use either the hash, the querystring or the pathname as the router implementation)
|
||||
//without needing to hard-code any syntax (`#` or `?`) in the `href` attribute.
|
||||
|
|
@ -256,12 +256,12 @@ m("a[href='/dashboard']", {config: m.route}, "Dashboard&q
|
|||
<p>Whether this is the first time we are running this function on this element. This flag is false the first time it runs on an element, and true on redraws that happen after the element has been created.</p>
|
||||
</li>
|
||||
<li><p><strong>Children children</strong> (optional)</p>
|
||||
<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 this argument is a string, it will be rendered as a text node. To render a string as HTML, see <a href="mithril.trust.html"><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>
|
||||
</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>
|
||||
<p>The returned VirtualElement is a javascript data structure that represents the DOM element to be rendered by <a href="mithril.render.html"><code>m.render</code></a></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue