子路由正在刷新父路由

时间:2017-04-07 15:34:31

标签: aurelia aurelia-router aurelia-framework

我在Aurelia的孩子路线正在刷新父路线。我不知道是什么造成的,有人可以帮助我吗?我有以下情况:

app.js

config.map([

              { route: ':username', moduleId: './components/profile/profile', name: 'profile', nav: false },
            ]);

profile.html

<div class="profile-post-content">
                <div class="profile-menu">
                    <a active-menu route-href="route: profile; params.bind: { username: username }" class="profile-menu-item menu-active">
                        <label>POSTS</label>
                    </a>
                    <a active-menu route-href="route: following" class="profile-menu-item">
                        <label>FOLLOWING</label
                        <p>${model.following}</p>
                    </a>
                    <a active-menu route-href="route: followers" class="profile-menu-item">
                        <label>FOLLOWERS</label>
                    </a>
                    <a active-menu route-href="route: albums" class="profile-menu-item">
                        <label>ALBUMS</label>
                    </a>
                </div>
                <router-view></router-view>
            </div>

profile.js

configureRouter(config, router){

        config.map([
          { route: '', moduleId: '../profile/feed', name: 'userfeed', title: 'POSTS', nav: true},
          { route: 'following', moduleId: '../profile/following', name: 'following', title: 'FOLLOWING', nav: true},
          { route: 'followers', moduleId: '../profile/followers', name: 'followers', title: 'FOLLOWERS', nav: true},
          { route: 'albums', moduleId: '../profile/albums', name: 'albums', title: 'ALBUMS', nav: true},

        ]);

        this.router = router;
    }

当我点击链接(POST,FOLLOWING等)时,会重新加载所有profile.html。

0 个答案:

没有答案