Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zswang/penjs
Mobile-side page small development framework.
https://github.com/zswang/penjs
framework mobile-web mvvm
Last synced: about 1 month ago
JSON representation
Mobile-side page small development framework.
- Host: GitHub
- URL: https://github.com/zswang/penjs
- Owner: zswang
- Created: 2017-04-05T09:38:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T13:05:03.000Z (over 7 years ago)
- Last Synced: 2024-10-03T09:47:54.615Z (about 1 month ago)
- Topics: framework, mobile-web, mvvm
- Language: JavaScript
- Size: 233 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
penjs
--------![logo](penjs.png)
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url]
Mobile-web small development framework.
## API
### constructer
```js
function penjs(element, options) {}
```## Example
```html
var info = {
createCount: 0,
destroyCount: 0,
}
<h1>jhtmls -- #{title} -- #{time}</h1>
<h3 :bind="info">create #{info.createCount} destroy: #{info.destroyCount}</h3>
var asc = 1;
<button @tap="now()">now</button>
<button @tap="ajax()">ajax</button>
<button @tap="sort(items, asc = -asc)">sort</button>
<button @tap="push(items)">push</button>
<ul :bind="items">
items.forEach(function (item) {
<li :bind="item" @create="info.createCount++" @destroy="info.destroyCount++">
if (item.editing === 'jhtmls') {
<input type="text"
:value="item.title"
@create="this.focus();"
@keydown.enter="this.blur();"
@focusout="item.title = this.value; item.editing = false;">
} else {
<span @dblclick="item.editing = 'jhtmls'">#{item.title}</span>
<button @tap="remove(items, item)">remove</button>
}
</li>
});
</ul>
```## License
MIT © [zswang](http://weibo.com/zswang)
[npm-url]: https://npmjs.org/package/penjs
[npm-image]: https://badge.fury.io/js/penjs.svg
[travis-url]: https://travis-ci.org/zswang/penjs
[travis-image]: https://travis-ci.org/zswang/penjs.svg?branch=master
[coverage-url]: https://coveralls.io/github/zswang/penjs?branch=master
[coverage-image]: https://coveralls.io/repos/zswang/penjs/badge.svg?branch=master&service=github