首页 技术 正文
技术 2022年11月10日
0 收藏 533 点赞 3,771 浏览 623 个字

具体以源码为准

Talent继承自Marionette继承自BackBone

Region:

  继承自Backbone.Event,show(view)会调用view.render(),然后$el.append(view.el),触发相应的事件

Layout:

  继承自 ItemView,可以设置regions属性

CompositeView:

  继承自collectionView,将Item添加到template中

  ’itemview:deleteItem’事件

itemViewOptions

CollectionView:

  继承自ItemView,将Item直接添加到$el中

ItemView:

  _deleteItem 自定义方法

  继承自View

inilialize:(options)接受options

templateHelpers 赋值options的方式可以将collectionView,compositeView传过来的model合并到 itemview的model

collection:

  where方法返回值是model数组而不是collection

避免 **-view-2.js的命名方式,而用**-view2.js(无法准确找到文件,可能是require的bug)

循环依赖是设计问题,应该打破循环,比如把另一个view A作为参数传到view B

backbone通过事件代理绑定事件,阻止事件冒泡即可防止事件在树形结构的dom中触发多次

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295