一個(gè)頁(yè)面可以同時(shí)存在多個(gè)<router-outlet>標(biāo)簽并顯示內(nèi)容嗎?項(xiàng)目中遇到一個(gè)存在header,左側(cè)可收縮列表,展示區(qū)同時(shí)存在的畫(huà)面---main.component.html---<app-header><app-header><div class="main"><div class="left"><router-outlet name="main_Left"></router-outlet></div><div class="right"><router-outlet name="main_Right"></router-outlet></div></div>---main.component.ts---this.router.navigate([{outlets: {main_Left: 'a'}}]);this.router.navigate([{outlets: {main_Right: 'b'}}]);可以在畫(huà)面初期化的時(shí)候同時(shí)加載main_left和mian_Right嗎?應(yīng)該怎么做?我現(xiàn)在在app.component.ts中設(shè)置的router(main_left,main_right)是平級(jí)不是父子關(guān)系另外,問(wèn)一下,如果我在header中有一個(gè)檢索條件列表,當(dāng)我點(diǎn)擊查詢(xún)的時(shí)候,怎么刷新左側(cè)列表?我現(xiàn)在是在main.component.html中,加的trigger,在header.ts中用的trigger.emit([param1])調(diào)用,但是我發(fā)現(xiàn)參數(shù)并不能傳遞過(guò)去有人可以幫助一下我嗎?謝謝
Angular2: 一個(gè)頁(yè)面可以同時(shí)存在多個(gè)<router-outlet>標(biāo)簽并顯示內(nèi)容嗎
尚方寶劍之說(shuō)
2019-01-05 21:20:37