Backbone Marionette Region show without render

后端 未结 2 938
我寻月下人不归
我寻月下人不归 2021-01-28 08:52

Is it possible to put a view that is already rendered into a backbone marionette region without rendering it again?

For example:

region.show(myView); //          


        
2条回答
  •  情话喂你
    2021-01-28 09:28

    // assume your view is already rendered
    region.ensureEl();
    region.open(myView);
    

    this is not recommend though, use region.show(myView) if you can. Since it's gonna close the previous view to clean up all the event listeners, etc...

提交回复
热议问题