lettuce
Version:
Lettuce JS, Mini Mobile Framework for Romantic with DSL.
86 lines (62 loc) • 2.02 kB
Markdown

[](https://travis-ci.org/phodal/lettuce)
[](http://http://img.shields.io/npm/v/lettuce.svg)
[](https://codeclimate.com/github/phodal/lettuce)
[](https://codeclimate.com/github/phodal/lettuce)
Lettuce is a Small & Powerful Framework for Romantic.
Online demo [http://phodal.github.io/lettuce](http://phodal.github.io/lettuce/#/).
1.new a instance
```javascript
var L = new lettuce();
```
2.define data
```javascript
var data = {
about: "Template",
what: "This about A Mobile Framework For Romantic",
why: "Why is a new Framework"
};
```
3.create function for router
```javascript
var aboutPage = function(){
var aboutPage = new L.SimpleView();
var templates = l.tmpl("<h3>{%=o.about%}</h3>", data);
return aboutPage.render(templates, "results");
};
var whyPage = function(){
var whyPage = new L.SimpleView();
var templates = l.tmpl("<h3>{%=o.why%}</h3>", data);
return whyPage.render(templates, "results");
};
var whatPage = function(){
var whatPage = new L.SimpleView();
var templates = l.tmpl("<h3>{%=o.what%}</h3>", data);
return whatPage.render(templates, "results");
};
```
4.Add router
```javascript
L.Router
.add(/
.add(/
.add(/
.load();
```
- Template
- Router
- Ajax
- Class
- Promise
- Event
- View
- Model
© 2015 [Phodal Huang](http://www.phodal.com). This code is distributed under the MIT license. See `LICENSE.txt` in this directory.
[待我代码编成,娶你为妻可好](http://www.xuntayizhan.com/person/ji-ke-ai-qing-zhi-er-shi-dai-wo-dai-ma-bian-cheng-qu-ni-wei-qi-ke-hao-wan/)