File tree Expand file tree Collapse file tree 1 file changed +35
-2
lines changed Expand file tree Collapse file tree 1 file changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,41 @@ npm install --save-dev @smui/tab
16
16
17
17
# Basic Usage
18
18
19
- todo...
20
-
19
+ Use if/else conditional constructs to display tab content, eg:
20
+
21
+ ``` javascript
22
+ < script>
23
+ import TabBar from ' @smui/tab-bar' ;
24
+ import Tab from ' @smui/tab' ;
25
+ import Paper , { Subtitle } from ' @smui/paper' ;
26
+ let active = ' Home' ;
27
+ < / script>
28
+ < TabBar tabs= {[' Home' , ' Merchandise' , ' About Us' ]} let: tab bind: active>
29
+ <!-- Note: the ` tab` property is required! -->
30
+ < Tab {tab} tabIndicator$transition= " fade" >
31
+ < Label> {tab}< / Label>
32
+ < / Tab>
33
+ < / TabBar>
34
+ {#if active === " Home" }
35
+ < Paper class = " paper-demo" >
36
+ < Title> Paper< / Title>
37
+ < Subtitle> This is a sheet of paper.< / Subtitle>
38
+ < Content> Home Content.< / Content>
39
+ < / Paper>
40
+ {: else if active === " Merchandise" }
41
+ < Paper class = " paper-demo" >
42
+ < Title> Paper< / Title>
43
+ < Subtitle> This is a sheet of paper.< / Subtitle>
44
+ < Content> Merchandise content.< / Content>
45
+ < / Paper>
46
+ {: else if active === " About Us" }
47
+ < Paper class = " paper-demo" >
48
+ < Title> Paper< / Title>
49
+ < Subtitle> This is a sheet of paper.< / Subtitle>
50
+ < Content> About Content.< / Content>
51
+ < / Paper>
52
+ {/ if }
53
+ ```
21
54
# Exports
22
55
23
56
todo...
You can’t perform that action at this time.
0 commit comments