angular / angular/components

Feature Request : Mat-Tab select by name.

Đang mở
#11,858 9 bình luận 19 reaction 0 người được giao Xem trên GitHub
area: material/tabs feature P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

#### Bug, feature request, or proposal:
Feature Request for material tabs

#### What is the expected behavior?
The ability to select a tab by its name, like this;

``

``

#### What is the current behavior?
``

#### What is the use-case or motivation for changing an existing behavior?

I am using the material tabs in a responsive app. When the app is in mobile size I display 5 tabs, when the app is in desktop size I display 3 tabs. The reason is since there is more room on the desktop I combine the content and show less tabs.

The issue is when I try to link to a specific tab via a URL. I would use a query parameter like ?tabindex=2. However since my tab index changes depending on the application size, the link will work in one case and not the other. So it would be useful to link to the tab by name like this, ?tab=profile. This way I can pass the name to the component and it can figure out the active tab regardless of the index number.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ các điểm vào mat-tab-group và mat-tab được mô tả trong issue, rồi xem xét cách selectedIndex hiện kiểm soát tab đang hoạt động. Xác định API lựa chọn dựa trên tên nên hoạt động như thế nào khi các tab được hiển thị hoặc kết hợp một cách responsive, sau đó xác minh rằng một URL như ?tab=profile sẽ chọn đúng tab mong muốn независимо với index của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.