https://github.com/cheft/riot-spa-template
a riot spa template
https://github.com/cheft/riot-spa-template
Last synced: 11 months ago
JSON representation
a riot spa template
- Host: GitHub
- URL: https://github.com/cheft/riot-spa-template
- Owner: cheft
- Created: 2015-02-01T07:24:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-09T05:42:19.000Z (almost 11 years ago)
- Last Synced: 2025-05-11T07:16:05.550Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 2.63 MB
- Stars: 24
- Watchers: 5
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README

# cheftjs
是基于 riot.js 薄封装的一套类 flux 框架
||=====================||
|| Application ||
||=====================||
|| Router ||
||=====================||
Tag --> do --> on
\ | /
\ Store /
\______________/
<--
## Application
var c = require('cheftjs');
var app = new c.Applicaton({
router: require('./router.js')
});
## Router - [like backbone](http://backbonejs.org/#Router-routes)
module.exports = {
routes: {
'': 'home'
},
home: function() {
}
}
## Tag - [base on riot](https://github.com/riot/riot)
{result}
test
## do
module.exports = {
do: {
clickMe: function() {
this.result = 'click success!';
this.trigger('clicked');
}
}
}
## Store
module.exports = {
store: ''
}
or
module.exports = {
store: {
url: '',
contentType: ''
}
}
### method
* get()
* save()
* del()
* post()
* put()
## on
module.exports = {
on: {
init: function() {}
mount: function() {}
update: function() {}
updated: function() {}
geted : function(data, status) {}
posted : function(data, status) {}
puted : function(data, status) {}
saved : function(data, status) {}
deleted: function(data, status) {}
clicked : function() {
console.log('the tag can auto update');
}
}
}
## Demo
cd demo
npm install
gulp

## [Project](https://github.com/cheft/extend-frontend)
