在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5  HTML/ angular2 routerLink path參數(shù)配置 函數(shù)運(yùn)行兩次問題

angular2 routerLink path參數(shù)配置 函數(shù)運(yùn)行兩次問題

鏈接地址https://stackoverflow.com/que...

<a [routerLink]="['/XXX', nextInfo()]"></a>

ts

numtotal=1;
nextInfo(){
    console.log(numtotal);
    numtotal++;
}

運(yùn)行結(jié)果是 nexInfo()在組件運(yùn)行的時候運(yùn)行了 兩次

回答
編輯回答
愚念

原因 結(jié)果 請看頭部鏈接

2017年1月4日 18:24