tweaks in docs

This commit is contained in:
Leo Horie 2016-12-31 08:35:50 -05:00
parent c8f2564cfe
commit c71ebf18ed
7 changed files with 61 additions and 38 deletions

View file

@ -10,6 +10,23 @@
Allows attaching lifecycle methods to a fragment [vnode](vnodes.md)
```javascript
var groupVisible = true
var log = function() {
console.log("group is now visible")
}
m("ul", [
m("li", "child 1"),
m("li", "child 2"),
groupVisible ? m.fragment({oninit: log}, [
// a fragment containing two elements
m("li", "child 3"),
m("li", "child 4"),
]) : null
])
```
---
### Signature