0

我有这个观点

define(['marionette', 'tpl!templates/profiles/_profile_item.html','vent'], function(Marionette, template,vent) {

  var ProfileItemView = Marionette.ItemView.extend({ 
    template: template,

    events: {
        "click button": function() {
            // alert(this.model.get('name') + " was clicked!");

        if(this.model.get('name')=='Guest')
          vent.trigger('navigate','player');
        else if(this.model.get('name')=='Create profile')
          vent.trigger('navigate','createProfile');
        else
          vent.trigger('navigate','loginProfile',{
                      name: this.model.get('name')
                      });

        }
    }

  });

  return ProfileItemView;

});

在 else 我触发导航并传递一些数据。我的问题是如何在触发事件后加载的下一个页面视图中读取该数据?

4

1 回答 1

1
    vent.on('navigate', this.someFunction);

    someFunction:function(e){
        // e your data
    }
于 2013-11-06T14:13:01.430 回答