nzMatchRouterExact in nz-menu-item not works
See original GitHub issueSteps to reproduce
I set different fragments in both nz-submenu and nz-menu-item, furthermore I set [nzMatchRouterExact]=“true” in nz-menu-item. I expected only nz-submenu is active, but not nz-menu-items. However, all of the nz-menu-item are active.
HTML codes:
<li nz-submenu nzTitle="联系我们" [routerLink]="['/contact-us',0]" [fragment]="['i0']">
<ul>
<li nz-menu-item [nzMatchRouter]="true" [nzMatchRouterExact]="true">
<a [routerLink]="['/contact-us',1]" [fragment]="['i1']">公司地址</a>
</li>
<li nz-menu-item [nzMatchRouter]="true" [nzMatchRouterExact]="true">
<!-- [class.ant-menu-item-selected]="(activeFragment | async) === 'i2'">-->
<a [routerLink]="['/contact-us',2]" [fragment]="['i2']">客户建议</a>
</li>
</ul>
</li>
Reproduce
https://stackblitz.com/edit/ng-zorro-antd-start-s3g69x?file=src/app/app.component.html
What is expected?
only nz-submenu is active, but not nz-menu-items.
What is actually happening?
all of the nz-menu-item are active.
| Environment | Info |
|---|---|
| ng-zorro-antd | 10.0.2 |
| Browser | chrome85.0.4183 and Safari |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Menu | NG-ZORRO - Ant Design
Automatically activate menu items based on routing, should work with routerLink. ... [nzDisabled], whether menu item is disabled or not, boolean, false.
Read more >Highlight current route item without clicking it - Stack Overflow
I have menu items that can be clicked and takes to different routes. When route is changed by clicking on item, it stays...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Is there any news?
Any updates?