Backbone.js Router initialization doesn't run immediately

后端 未结 3 583
名媛妹妹
名媛妹妹 2021-01-20 23:49

My code is as follows:

var AppRouter = Backbone.Router.extend({

    _data: null,
    _length: 0,
    _index: null,
    _todos: null,
    _subtodolist: null,
            


        
3条回答
  •  情歌与酒
    2021-01-21 00:01

    Your problem is the order of your routes. Routes are evaluated in order so the "*action" will ALWAYS match.

    Try:

    routes: {
      "category/:name": "hashcategory"
      "*action": "index",
    }
    

提交回复
热议问题