Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deepraining/see-view
一个 JQuery 事件绑定的快捷方式,类似 Backbone.View. A shortcut way of event binding for JQuery, like Backbone.View.
https://github.com/deepraining/see-view
bind event jquery view
Last synced: about 5 hours ago
JSON representation
一个 JQuery 事件绑定的快捷方式,类似 Backbone.View. A shortcut way of event binding for JQuery, like Backbone.View.
- Host: GitHub
- URL: https://github.com/deepraining/see-view
- Owner: deepraining
- License: mit
- Created: 2017-03-27T23:53:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-30T02:04:26.000Z (over 5 years ago)
- Last Synced: 2024-05-08T12:13:45.331Z (6 months ago)
- Topics: bind, event, jquery, view
- Language: JavaScript
- Homepage:
- Size: 60.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.en.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# see-view
[中文文档](./README.md)
A shortcut way of event binding for JQuery, like Backbone.View.
```
npm install see-view --save
``````
import seeView from 'see-view';seeView({
events: {
'eventName selectors': 'methodName', // default use event delegating
'!eventName selectors': 'methodName', // do not use event delegating.
},
methodName(e) {
// do something
},
});
```- `eventName`: event name, `click, focus, ...`
- `selectors`: use `,` to split multiple selectors, `#id`, `#id, .class, tagName`, `#id tagName, .class tagName`
- use spaces to split eventName and selectors
- if you do not want to use event delegating, add `!` before `eventName`