1

Marionette.Backbone を使用して webapp を作成しています。レイアウトを作成して 3 つのサブビューを追加するモジュールを取得しました。

レイアウトは正常にレンダリングされますが、領域は各サブ ビューで埋められません。何が欠けていますか。コンソールにエラーはありません。

これは私のコントローラーです:

@Appic.module "ProjectsApp.Add", (Add, App, Backbone, Marionette, $, _) ->

    Add.Controller =

        addProject: ->
            @layout = @getLayoutView()

            @layout.on "show", =>
                @showLeft
                @showContent
                @showRight

            App.mainRegion.show @layout

        showLeft: ->
            leftView = @getLeftView
            @layout.leftRegion.show leftView

        showContent: ->
            contentView = @getContentView
            @layout.contentRegion.show contentView

        showRight: ->
            rightView = @getRightView
            @layout.rightRegion.show rightView

        getLeftView: ->
            new Add.Left

        getContentView: ->
            new Add.Form

        getRightView: ->
            new Add.Right

        getLayoutView: ->
            new Add.Layout

これはモジュールの私のビュー部分です

@Appic.module "ProjectsApp.Add", (Add, App, Backbone, Marionette, $, _) ->

    class Add.Layout extends App.Views.Layout
        template: "projects/add/templates/add_layout"

        regions:
            leftRegion: "#left-region"
            contentRegion: "#content-region"
            rightRegion: "#right-region"

    class Add.Left extends App.Views.ItemView
        template: "projects/add/templates/_left"

    class Add.Right extends App.Views.ItemView
        template: "projects/add/templates/_right"

    class Add.Form extends App.Views.ItemView
        template: "projects/add/templates/_form"
4

1 に答える 1