Backbone.View “el” confusion

前端 未结 3 983
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 17:15

How should a view\'s el be handled? It has to be set, otherwise events don\'t fire (see here).

But should it be an element that is already on the page?

3条回答
  •  Happy的楠姐
    2020-11-30 17:53

    You want your 'el' to reference an element that contains a child element that has any event that triggers a change in your view. Could be as wide as a "body" tag.

提交回复
热议问题