3 category: JavaScript libraries
23 <script>riot.mount('*')</script>
24 <script>riot.mount('tag-name')</script>
25 <script>riot.mount('tag-name', { title: 'my app', ... })</script>
32 {value || 'its a js expression'}
34 <input checked={null}> /* null values ignore the tag */
35 <p class={ selected: true }>
41 <li each={movies}>{title}</li>
47 <div show={error}> /* show using display: '' */
48 <div hide={error}> /* hide using display: none */
56 this.go = function (e) { ... }
63 this.update({ data: 'hi' }
66 this.unmount(true) // keep parent tag
68 riot.update() // update all
76 var child = this.tags.child
84 <child name='xyz'></child>
85 var child = this.tags.xyz
99 <yield to='title'>Hello</yield>
100 <yield to='body'>Hey there world</yield>
106 <yield from='title'/>
114 riot.route('customers/*/edit', (id) => {
116 riot.route('customers/234/edit')
118 riot.route.start(true) // exec the current url
124 this.on('before-mount', function() {
125 // before the tag is mounted
128 this.on('mount', function() {
129 // right after the tag is mounted on the page
132 this.on('update', function() {
133 // allows recalculation of context data before the update
136 this.on('updated', function() {
137 // right after the tag template is updated
140 this.on('before-unmount', function() {
141 // before the tag is removed
144 this.on('unmount', function() {
145 // when the tag is removed from the page
148 // curious about all events ?
149 this.on('all', function(eventName) {
150 console.info(eventName)