Implement routing in Sencha Touch 2.4.0
我正在尝试在 Sencha Touch 2.4.0 中实现路由,但无法在路由更改事件中触发函数。我有一个主控制器-
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Ext.define(‘STPG.controller.Main’, {
extend: ‘Ext.app.Controller’, routes : { config: { }, } //called when the Application is launched, remove if not needed }, |
app.js
|
1
2 3 4 5 6 7 |
views: [
‘Main’ ], models: [], |
正在尝试-
|
1
2 |
Ext.Viewport.add(Ext.create(‘STPG.view.Main’));
this.redirectTo(‘home’); |
它没有调用那个函数。
你犯了一个愚蠢的错误。只需将您的 routes: {} 放入 config 中。你的问题解决了。
编码愉快!
来源:https://www.codenong.com/27440473/
