Ember.js routing: how do you set a default route to render immediately?

后端 未结 3 699
日久生厌
日久生厌 2021-02-09 04:07

I\'m sure this will become clear as I dig in deeper, but for now it\'s not obvious how to make this happen.

I was following the info on this helpful SO article about ro

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 05:03

    With Ember CLI, you can put the redirect in index.js in your root of routes directory:

    import Ember from 'ember';
    
    export default Ember.Route.extend( {
      redirect: function() {
        this.transitionTo('dashboard');
      }
    });
    

提交回复
热议问题