2014-12-30 09:42:31 +01:00
<!--suppress CheckEmptyScriptTag -->
2014-12-11 08:30:27 +01:00
<rt-require dependency="./playground" as="playground"/>
2014-12-30 16:33:28 +01:00
<rt-require dependency="./CodeMirrorViewer" as="viewer"/>
2014-12-02 15:57:18 +01:00
<div id="examples">
<div class="example">
2015-01-04 18:47:51 +01:00
<h3>Hello world in React Templates</h3>
2014-12-02 15:57:18 +01:00
<p>
2015-01-04 18:47:51 +01:00
Simple "Hello world" HTML transformed into React JavaScript code.
2014-12-02 15:57:18 +01:00
</p>
2014-12-30 09:42:31 +01:00
<playground id="helloExample" rt-props="this.state.samples.hello" direction="horizontal"></playground>
2014-12-02 15:57:18 +01:00
</div>
<div class="example">
2015-01-04 18:47:51 +01:00
<h3>rt-if</h3>
2014-12-02 15:57:18 +01:00
<p>
2015-01-04 18:47:51 +01:00
This shows the use of rt-if.
2014-12-02 15:57:18 +01:00
</p>
2014-12-07 14:12:50 +01:00
<playground id="ifExample" rt-props="this.state.samples.rtIf" direction="horizontal"></playground>
2014-12-02 15:57:18 +01:00
</div>
<div class="example">
2015-01-04 18:47:51 +01:00
<h3>rt-repeat</h3>
2014-12-02 15:57:18 +01:00
<p>
2015-01-04 18:47:51 +01:00
This uses rt-repeat to show multiple items and rt-scope to create a reusable name for multiple calculations.
2014-12-02 15:57:18 +01:00
</p>
2014-12-07 14:12:50 +01:00
<playground id="repeatExample" rt-props="this.state.samples.repeat" direction="horizontal"></playground>
2014-12-02 15:57:18 +01:00
</div>
<div class="example">
2015-01-04 18:47:51 +01:00
<h3>rt-props</h3>
2014-12-02 15:57:18 +01:00
<p>
2015-01-04 18:47:51 +01:00
rt-props is used to pass all the original properties set on this component (except the ones used for the component logic: onClick and eventId) to the element that will actually represent this component.
2014-12-02 15:57:18 +01:00
</p>
2014-12-07 14:12:50 +01:00
<playground id="propsExample" rt-props="this.state.samples.props" direction="horizontal"></playground>
</div>
<div class="example">
<h3>Improved todo list</h3>
<p>
2015-01-04 21:11:52 +01:00
Every project needs a todo list example, so here is ours.
2014-12-07 14:12:50 +01:00
</p>
<playground id="todoExample" rt-props="this.state.samples.todo" direction="horizontal"></playground>
</div>
<div class="example">
<h3>Weather</h3>
<p>
2015-01-04 18:47:51 +01:00
This example shows working with async events, the usage of regular event handler function pointers instead of lambda expression, and working with two-way binding.
2014-12-07 14:12:50 +01:00
</p>
<playground id="weatherExample" rt-props="this.state.samples.weather" direction="horizontal"></playground>
2014-12-02 15:57:18 +01:00
</div>
2014-12-30 20:19:49 +01:00
<div id="rt-require" class="example">
<h3>rt-require</h3>
<p>
2015-01-04 18:47:51 +01:00
This example shows how to load other React components and libraries into a React template and then use them within the template.
2014-12-30 20:19:49 +01:00
</p>
<viewer rt-props="this.state.rtRequire" mode="javascript" />
</div>
2014-12-30 16:33:28 +01:00
<div id="amd" class="example">
<h3>AMD</h3>
<p>
2015-01-04 18:47:51 +01:00
This example shows the rt-require sample output with AMD support.
2014-12-30 16:33:28 +01:00
</p>
<viewer rt-props="this.state.amd" mode="javascript" />
</div>
<div id="commonjs" class="example">
<h3>CommonJS</h3>
<p>
2015-01-04 18:47:51 +01:00
This example shows the rt-require sample output with CommonJS support.
2014-12-30 16:33:28 +01:00
</p>
<viewer rt-props="this.state.cjs" mode="javascript" />
</div>
2015-02-19 13:49:11 +01:00
<div id="es6" class="example">
<h3>ES6</h3>
<p>
This example shows the rt-require sample output with ES6 support.
</p>
<viewer rt-props="this.state.es6" mode="javascript" />
</div>
2014-12-11 08:30:27 +01:00
</div>