update docs, add descriptions for api methods
This commit is contained in:
parent
d56c30cc4a
commit
cdb9017a72
25 changed files with 613 additions and 40 deletions
|
|
@ -1,5 +1,6 @@
|
|||
# mount(root, component)
|
||||
|
||||
- [Description](#description)
|
||||
- [Signature](#signature)
|
||||
- [How it works](#how-it-works)
|
||||
- [Performance considerations](#performance-considerations)
|
||||
|
|
@ -7,6 +8,27 @@
|
|||
|
||||
---
|
||||
|
||||
### Description
|
||||
|
||||
Activates a component, enabling it to autoredraw on user events
|
||||
|
||||
```javascript
|
||||
var state = {
|
||||
count: 0,
|
||||
inc: function() {state.count++}
|
||||
}
|
||||
|
||||
var Counter = {
|
||||
view: function() {
|
||||
return m("div", {onclick: state.inc}, state.count)
|
||||
}
|
||||
}
|
||||
|
||||
m.mount(document.body, Counter)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Signature
|
||||
|
||||
`m.mount(element, component)`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue