How to set default activationStrategy in aurelia

后端 未结 3 1247
心在旅途
心在旅途 2020-12-19 01:37

Aurelia normally ignores any changes in the querystring.

It is possible to set the activationStrategy to invoke-lifecycle in the VM so it w

3条回答
  •  一生所求
    2020-12-19 02:05

    activationStrategy is a property of RouterConfig, which represents the route config object used by config.map(). I think that you need to set it on each route definition.

    Example:

    configureRouter(config, router) {
      ...
      config.map([
        { 
          route: ['', 'home'],       
          name: 'home',       
          moduleId: 'home/index', 
          activationStrategy: 'invoke-lifecycle'
        }
      ]);
      ...
    }
    

    (Edit reason: I've made a terrible mistake by misreading your question at first, sorry :))

提交回复
热议问题