"/ b"경로에서 내 백본 앱을 제공해야하고 라우터에 연결하는 데 문제가 있습니다. 그것은 단지보기를 보여 주면 잘 작동하지만, 내 라우터에 연결했을 때 내 루트 컨트롤러 기능이 작동하지 않습니다.마리오 네트 라우터가 아닌 인덱스 루트 경로
라우터 (발사 확인)
define('appRouter', ['marionette', 'rootView', 'changePasswordView'], function(Marionette, rootView, changePasswordView) {
return Marionette.AppRouter.extend({
routes: {
'/b/change-password': 'showChangePassword',
'/b': 'showAccountSettings'
},
showChangePassword: function() {
this.showView(new changePasswordView());
},
showAccountSettings: function() {
this.showView(new rootView());
}
});
});
애플리케이션 ONSTART :
var Application = Marionette.Application.extend({
...
onStart: function(options) {
console.log('on start');
var router = new appRouter(options);
/** Starts the URL handling framework */
if(! Backbone.History.started) Backbone.history.start();
router.initialize();
},
...
});
내가 방문 할 때 http://localhost:8080/b
(내 인덱스 모든 집중적 인 목적이다)는 빈 페이지를 렌더링합니다.
당신이 당신의 Marionette.Application의 경로를 등록을? 그 코드를 게시 할 수 있습니까? –
그게 내가 누락 된 것일 수도 있습니다. onStart는'''Application = Marionette.Application.extend ({...})''클래스 확장 – goofiw