zoukankan      html  css  js  c++  java
  • Backbone,Marionette,Talent学习笔记

    具体以源码为准

    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中触发多次

  • 相关阅读:
    解决无法安装Microsoft .Net Framework 3.5
    day11-15,装饰器
    Xmanager Power Suit 6.0.0009 最新版注册激活
    eth
    MySql 8.0 版本使用navicat连不上解决
    day11
    Mybatis使用规则
    nginx的基本配置
    Mybatis分页插件PageHelper使用
    dubbo的使用
  • 原文地址:https://www.cnblogs.com/chengzhenping/p/3987886.html
Copyright © 2011-2022 走看看