使用角度材料 2 选项卡单击按钮后如何进行导航 [英] How to do navigation after button has been clicked using angular material 2 tabs

查看:16
本文介绍了使用角度材料 2 选项卡单击按钮后如何进行导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用有角度的材料 2 个选项卡,我希望在一个选项卡中有下一个按钮,单击它后导航到另一个选项卡.我应该使用什么来实现该功能?

I am using angular material 2 tabs and i wanted to have next button in one tab which navigates to another tab after clicking it. What should i need to use to achieve that functionality?

推荐答案

非常简单:

<mat-tab-group class="demo-tab-group" #matgroup>
    ....
</mat-tab-group>

<button (click)='matgroup.selectedIndex = 2'>Go Next</button>

工作演示

这篇关于使用角度材料 2 选项卡单击按钮后如何进行导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆