Formatting
This commit is contained in:
parent
ef8216de60
commit
226f3e140b
|
@ -1,6 +1,6 @@
|
|||
<div class='site-header'>
|
||||
<div class='container'>
|
||||
This is <a href="."><em>{{ site.meta.name }}</em></a> — collection of cheatsheets I've written.
|
||||
This is <a href="."><em>{{ site.meta.name }}</em></a> — a collection of cheatsheets I've written.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
35
ractive.md
35
ractive.md
|
@ -34,9 +34,9 @@ vim: ft=javascript
|
|||
sanitize: false
|
||||
})
|
||||
|
||||
### Instance methods
|
||||
## Instance methods
|
||||
|
||||
Updating values:
|
||||
### Updating values
|
||||
|
||||
view.add('count', 1) //=> promise
|
||||
view.subtract('count', 1) //=> promise
|
||||
|
@ -50,7 +50,7 @@ Updating values:
|
|||
view.get('a')
|
||||
view.data.a
|
||||
|
||||
Nodes and components:
|
||||
### Nodes and components
|
||||
|
||||
view.find('.klass')
|
||||
view.findAll('.klass')
|
||||
|
@ -60,13 +60,13 @@ Nodes and components:
|
|||
view.findComponent('photo')
|
||||
view.findAllComponents('photo')
|
||||
|
||||
Events:
|
||||
### Events
|
||||
|
||||
view.on('event', function() { ... })
|
||||
view.off('event', fn)
|
||||
view.fire('event')
|
||||
|
||||
Etc:
|
||||
### Others
|
||||
|
||||
view.update()
|
||||
view.updateModel()
|
||||
|
@ -78,14 +78,17 @@ Etc:
|
|||
view.toHTML() //=> String
|
||||
view.render()
|
||||
|
||||
### Extend
|
||||
## Extend
|
||||
|
||||
View = Ractive.extend({
|
||||
...
|
||||
})
|
||||
new View()
|
||||
|
||||
### [Components](https://github.com/RactiveJS/Ractive/wiki/Components)
|
||||
## [Components](https://github.com/RactiveJS/Ractive/wiki/Components)
|
||||
|
||||
See: https://github.com/RactiveJS/Ractive/issues/74
|
||||
{:.center}
|
||||
|
||||
Widget = Ractive.extend({ ... })
|
||||
|
||||
|
@ -97,14 +100,12 @@ Etc:
|
|||
}
|
||||
});
|
||||
|
||||
See: https://github.com/RactiveJS/Ractive/issues/74
|
||||
|
||||
### Partials
|
||||
## Partials
|
||||
|
||||
// Global partials
|
||||
Ractive.partials.x = "<..>"
|
||||
|
||||
### Events
|
||||
## Events
|
||||
|
||||
view.on('teardown')
|
||||
|
||||
|
@ -127,7 +128,7 @@ See: https://github.com/RactiveJS/Ractive/issues/74
|
|||
console.log("Changed name to", name);
|
||||
}, { init: false });
|
||||
|
||||
### Markup
|
||||
## Markup
|
||||
|
||||
Hello, {{name}}
|
||||
Body: {{{unescaped}}}
|
||||
|
@ -147,7 +148,7 @@ See: https://github.com/RactiveJS/Ractive/issues/74
|
|||
|
||||
{{#statusDogs[selected]}}
|
||||
|
||||
### Transformed attributes
|
||||
## Transformed attributes
|
||||
|
||||
This transforms the `list` attribute via a helper function called `sort()`.
|
||||
|
||||
|
@ -159,7 +160,7 @@ This transforms the `list` attribute via a helper function called `sort()`.
|
|||
sort: function(array, column) { return array.whatever(); }
|
||||
}
|
||||
|
||||
### Transitions
|
||||
## Transitions
|
||||
|
||||
<div intro="fade">
|
||||
<div intro="bump">
|
||||
|
@ -180,7 +181,7 @@ This transforms the `list` attribute via a helper function called `sort()`.
|
|||
t.complete();
|
||||
};
|
||||
|
||||
### [Decorators](http://docs.ractivejs.org/latest/decorators)
|
||||
## [Decorators](http://docs.ractivejs.org/latest/decorators)
|
||||
|
||||
<span decorator="tooltip:hello there">Hover me</span>
|
||||
|
||||
|
@ -199,7 +200,7 @@ This transforms the `list` attribute via a helper function called `sort()`.
|
|||
|
||||
tooltip: function (node, a, b, two, c) { ... }
|
||||
|
||||
### [Adaptors](http://docs.ractivejs.org/latest/adaptors)
|
||||
## [Adaptors](http://docs.ractivejs.org/latest/adaptors)
|
||||
|
||||
myAdaptor = {
|
||||
filter: function (object, keypath, ractive) {
|
||||
|
@ -221,7 +222,7 @@ This transforms the `list` attribute via a helper function called `sort()`.
|
|||
}
|
||||
};
|
||||
|
||||
### [Computed properties](http://docs.ractivejs.org/latest/computed-properties)
|
||||
## [Computed properties](http://docs.ractivejs.org/latest/computed-properties)
|
||||
|
||||
new Ractive({
|
||||
template: '{{area}}',
|
||||
|
|
Loading…
Reference in New Issue