更改角度垫选项卡的顺序

时间:2018-11-14 14:04:53

标签: angular angular-material

我正在使用Angular Material中的<mat-tab-group #tabsGroup (selectedTabChange)="tabChanged($event)" (selectedIndexChange)="selectedIndexChange($event)" [(selectedIndex)]="selectedIndex"> <mat-tab id="tab0" label="First tab"> // Tab content </mat-tab> <mat-tab id="tab1" label="Second tab"> // Tab content </mat-tab> <mat-tab id="tab2" label="Third tab"> // Tab content </mat-tab> <mat-tab-group> ,并且需要根据某些条件动态创建标签。

<mat-tab-group #tabsGroup (selectedTabChange)="tabChanged($event)" (selectedIndexChange)="selectedIndexChange($event)" [(selectedIndex)]="selectedIndex">
    <mat-tab id="tab1" label="Second tab">
        // Tab content
    </mat-tab>
    <mat-tab id="tab0" label="First tab">
        // Tab content
    </mat-tab>
    <mat-tab id="tab2" label="Third tab">
        // Tab content
    </mat-tab>
<mat-tab-group>

根据某些条件,例如,我需要能够生成如下标签:

#EXTM3U
#EXT-X-TARGETDURATION:11
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-START:TIME-OFFSET=250,PRECISE=YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:9.9766,
#EXT-X-BYTERANGE:678116@0
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:668340@678116
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:667588@1346456
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:679432@2014044
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:667964@2693476
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:668340@3361440
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:680748@4029780
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:668904@4710528
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:668904@5379432
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:680936@6048336
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:670032@6729272
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:671160@7399304
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:683756@8070464
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:672288@8754220
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:671536@9426508
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:684132@10098044
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:673228@10782176
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:671536@11455404
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:683756@12126940
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:671160@12810696
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:671912@13481856
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:686012@14153768
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:673980@14839780
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:672288@15513760
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:682816@16186048
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:671536@16868864
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:672664@17540400
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:685636@18213064
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:673604@18898700
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:674356@19572304
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:663640@20246660
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9766,
#EXT-X-BYTERANGE:685636@20910300
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:673792@21595936
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:675484@22269728
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:685636@22945212
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:674168@23630848
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:675296@24305016
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:686200@24980312
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:674920@25666512
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:674920@26341432
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:687328@27016352
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:675860@27703680
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:675672@28379540
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:687328@29055212
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:675860@29742540
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:676236@30418400
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:689020@31094636
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:677364@31783656
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:678492@32461020
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:690712@33139512
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:678304@33830224
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:679056@34508528
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:691088@35187584
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:679620@35878672
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:680184@36558292
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:692404@37238476
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:679620@37930880
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:679244@38610500
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:691840@39289744
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:679996@39981584
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:662136@40661580
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:679996@41323716
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:693344@42003712
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:681124@42697056
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:679056@43378180
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:691652@44057236
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:680748@44748888
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:680560@45429636
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:692780@46110196
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:681312@46802976
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:679808@47484288
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:692216@48164096
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:680936@48856312
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:682628@49537248
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:694848@50219876
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:683192@50914724
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:683004@51597916
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:695412@52280920
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:683380@52976332
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:683004@53659712
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:695600@54342716
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:684696@55038316
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:684508@55723012
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:697480@56407520
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:683568@57105000
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:684132@57788568
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:696916@58472700
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:685824@59169616
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:685260@59855440
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:674356@60540700
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9766,
#EXT-X-BYTERANGE:696916@61215056
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:684696@61911972
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:685636@62596668
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:699548@63282304
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:687516@63981852
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:689396@64669368
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:699924@65358764
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:685072@66058688
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:687328@66743760
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:699172@67431088
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:686388@68130260
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:687704@68816648
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:698984@69504352
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:687892@70203336
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:687516@70891228
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:699360@71578744
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:687516@72278104
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:689960@72965620
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:700676@73655580
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:688832@74356256
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:690336@75045088
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:703308@75735424
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:690148@76438732
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:692592@77128880
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:702368@77821472
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:690712@78523840
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:691840@79214552
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:702932@79906392
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:690336@80609324
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:691464@81299660
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:672664@81991124
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9766,
#EXT-X-BYTERANGE:703684@82663788
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:692968@83367472
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:692592@84060440
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:702932@84753032
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:692028@85455964
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:690712@86147992
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:705000@86838704
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:693344@87543704
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:692780@88237048
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:704812@88929828
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:693156@89634640
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:692404@90327796
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:706316@91020200
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:693908@91726516
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:693908@92420424
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:705940@93114332
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:694284@93820272
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:693344@94514556
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:705940@95207900
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:694284@95913840
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:695036@96608124
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:707444@97303160
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:696352@98010604
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:694660@98706956
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:707444@99401616
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:696164@100109060
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:695788@100805224
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:708572@101501012
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:697480@102209584
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:681688@102907064
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:697104@103588752
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:708760@104285856
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:697480@104994616
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:698984@105692096
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:710264@106391080
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:697856@107101344
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:698044@107799200
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:709512@108497244
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:697856@109206756
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:698420@109904612
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:711392@110603032
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:698608@111314424
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:700112@112013032
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:709136@112713144
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:697856@113422280
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:698608@114120136
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:711768@114818744
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:698796@115530512
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:700676@116229308
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:711956@116929984
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:698608@117641940
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:699736@118340548
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:712896@119040284
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:701616@119753180
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:701992@120454796
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:714024@121156788
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:700488@121870812
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:10.01,
#EXT-X-BYTERANGE:701240@122571300
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:9.9433,
#EXT-X-BYTERANGE:682628@123272540
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXTINF:4.2151,
#EXT-X-BYTERANGE:320352@123955168
https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/gear2/main.ts
#EXT-X-ENDLIST

MatTabs API上是否有设置,或者我可以通过JavaScript做到这一点?谢谢!

2 个答案:

答案 0 :(得分:1)

您可以尝试使用*ngFor来使标签保持动态

html

<mat-tab-group #tabsGroup (selectedTabChange)="tabChanged($event)" (selectedIndexChange)="selectedIndexChange($event)" [(selectedIndex)]="selectedIndex">
    <mat-tab *ngFor="let tab in tabList" id="{{tab.tabId}}" label="tab.label">
        <div [innerHtml]="tab.innerHtml"></div>
    </mat-tab>
<mat-tab-group>

ts

tabList = [{
  label: 'First Tab',
  innerHtml: `<div>hello, World!</div>`,
  tabId: 'tab1'
}, {
  label: 'Second Tab',
  innerHtml: `<div>I am a different Tab</div>`,
  tabId: 'tab2'
}];

然后从那里可以根据需要对this.tabList对象进行排序


编辑:

*ngIf上有关<mat-tab>的评论中有一个问题之后,下面是对*ngIf语句的修改后答案

html

<mat-tab-group #tabsGroup (selectedTabChange)="tabChanged($event)" (selectedIndexChange)="selectedIndexChange($event)" [(selectedIndex)]="selectedIndex">
    <ng-template ngFor let-tab [ngForOf]="tabList">
        <mat-tab *ngIf="tab.showTab || someHideFunction(tab)" id="{{tab.tabId}}" label="tab.label">
            <div [innerHtml]="tab.innerHtml"></div>
        </mat-tab>
    </ng-template>
<mat-tab-group>

ts

tabList = [{
  label: 'First Tab',
  innerHtml: `<div>hello, World!</div>`,
  tabId: 'tab1',
  showTab: true
}, {
  label: 'Second Tab',
  innerHtml: `<div>I am a different Tab</div>`,
  tabId: 'tab2',
  showTab: false
},  {
  label: 'Third Tab',
  innerHtml: `<app-custom-component [input]="tempVariable"></app-custom-component>`,
  tabId: 'tab3',
  showTab: true
}];

答案 1 :(得分:0)

您可以像下面这样使用ng-template

<ng-template #content1>
  <div>Content 1</div>
</ng-template>

<ng-template #content2>
  <div>Content 2!</div>
</ng-template>

然后相应地在标签中使用。

<mat-tab id="tab0" [label]="yourFirstLabel">
    <div *ngIf="yourFlag; then content1 else content2"> </div>
</mat-tab>
<mat-tab id="tab1" [label]="yourSecondLabel">
    <div *ngIf="yourFlag; then content2 else content1"> </div>  
</mat-tab>

请注意,您也需要更新标签(yourFirstLabelyourSecondLabel