backbone-ext

0.0.2 • Public • Published

backbone扩展

定义了RootView,所有的View将从RootView继承;RootView只有一个实例。

let RootView = require("backbone-ext")
let AppView = RootView.exnted({
    el: "",
    events: {},
    constructor: function(){

    }
})

AppView继承RootView,获得RootView上的原型方法

RootView RootView.prototype.addChildView(RootView view)

RootView RootView.prototype.removeChildView(RootView view)

RootView[] RootView.prototype.getChildViewByClass(Class class)

RootView RootView.prototype.getChildViewByIndex(Number index)

Number RootView.prototype.getIndexOfChildView(RootView view)

Number RootView.prototype.hasChildView(RootView view)

Boolean RootView.prototype.containChildView(RootView view)

RootView RootView.prototype.emit(String eventName, Event event, Object params)

RootView RootView.prototype.broadcast(String eventName, Object params)

Readme

Keywords

none

Package Sidebar

Install

npm i backbone-ext

Weekly Downloads

3

Version

0.0.2

License

none

Last publish

Collaborators

  • zhenglianfu