Skip to content

Commit

Permalink
blear.classes.view-model
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed May 20, 2016
1 parent 002b77f commit 6013446
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blear.classes.view-model",
"version": "1.0.1",
"version": "1.0.2",
"description": "视图数据模型类",
"scripts": {
"live": "browser-sync start --config bs-config.js",
Expand Down
34 changes: 22 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,28 @@
[coveralls-img]: https://img.shields.io/coveralls/blearjs/blear.classes.view-model/master.svg?maxAge=2592000&style=flat-square
[coveralls-url]: https://coveralls.io/github/blearjs/blear.classes.view-model?branch=master

相对于模板,扩展了以下实例指令

## 入门
```
var vm = new ViewModel({
el: '#demo',
// 可省略,默认为 el.innerHTML,也可以是模板节点、模板数据
template: '#template',
data: {
username: '123'
},
methods: {}
});
```

+

```
<div id="demo">
<input type="text" @model="username">
</div>
```


## 事件
- 事件的上下文为 `data`
Expand All @@ -37,14 +58,3 @@
@model="exp"
```

## 入门
```
var vm = new ViewModel({
el: '#demo',
// 可省略,默认为 el.innerHTML,也可以是模板节点、模板数据
template: '#template',
data: {},
methods: {}
});
```

0 comments on commit 6013446

Please sign in to comment.