We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
假设个场景:做一个菜单,有的节点是点击出现子节点,有的节点是点击跳转路由
想要实现是连接则跳转,不是连接则不跳转,可以这样做。
ts
isLink : boolean = false;
html
<div [routerLink]="isLink ? data.url : null" routerLinkActive="node-active"> </div>
css
.node-active{ background: #006189; }
可以正常跳转,但是路由只要是Null的话就会处于激活状态,所以还需对routerLinkActive进行判断。
routerLinkActive
<div [routerLink]="isLink ? null : data.url" routerLinkActive="{{isLink ? 'node-active' : null }}"> </div>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
想要实现是连接则跳转,不是连接则不跳转,可以这样做。
ts
html
css
可以正常跳转,但是路由只要是Null的话就会处于激活状态,所以还需对
routerLinkActive
进行判断。html
The text was updated successfully, but these errors were encountered: