Add ForEach to demo

feature/ForEach
KernelDeimos 3 years ago
parent 071a32a8b4
commit 199e2dfa59

@ -1,9 +1,10 @@
// const justact = require('justact'); // const justact = require('justact');
import * as justact from 'justact'; import * as justact from 'justact';
import { ForEach } from 'justact';
class InputMultiplex extends justact.Component { class InputMultiplex extends justact.Component {
render () { render () {
console.log('InputMultiplex', this);
return this.swap ? ( return this.swap ? (
<input value={this.valueB$} type="text" /> <input value={this.valueB$} type="text" />
) : ( ) : (
@ -18,6 +19,9 @@ class App extends justact.Component {
<div> <div>
<input type="checkbox" value={this.swap$} /> <input type="checkbox" value={this.swap$} />
<InputMultiplex swap={this.swap$}></InputMultiplex> <InputMultiplex swap={this.swap$}></InputMultiplex>
<ForEach array={[1,2,3]} render={item => (
<input value={item} disabled />
)} />
</div> </div>
) )
} }

Loading…
Cancel
Save