Backbone Bolierplate 内で LayoutManager を使用する方法について、誰かが説明/例を提供できますか?
app.js 内で、メインのアプリ オブジェクトを拡張する useLayout 関数を確認できます。ここでは、基本レイアウト要素を設定しているようです:
// Helper for using layouts.
useLayout: function(name, options) {
// Enable variable arity by allowing the first argument to be the options
// object and omitting the name argument.
if (_.isObject(name)) {
options = name;
}
// Ensure options is an object.
options = options || {};
// If a name property was specified use that as the template.
if (_.isString(name)) {
options.template = name;
}
// Create a new Layout with options.
var layout = new Backbone.Layout(_.extend({
el: "#main"
}, options));
// Cache the refererence.
return this.layout = layout;
}
あれは正しいですか?もしそうなら、どうにかしてアプリケーション ルーターで「UseLayout」機能を使用できますか? ...さまざまな UI 要素/ネストされたビューをメイン ビューに追加するには?
ありがとう。