You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrapper of the [CodeGroupItem](#codegroupitem) components.
37
+
38
+
## CodeGroupItem
39
+
40
+
- Props:
41
+
- title
42
+
- Type: `string`
43
+
- Required: `true`
44
+
- active
45
+
- Type: `boolean`
46
+
- Default: `false`
47
+
48
+
- Details:
49
+
50
+
This component must be placed inside a [CodeGroup](#codegroup) component.
51
+
52
+
Use the `active` prop to set the initial active item, or the first item will be activated by default.
53
+
54
+
- Example:
55
+
56
+
**Input**
57
+
58
+
````md
59
+
<CodeGroup>
60
+
<CodeGroupItem title="YARN">
61
+
62
+
```bash:no-line-numbers
63
+
yarn
64
+
```
65
+
66
+
</CodeGroupItem>
67
+
68
+
<CodeGroupItem title="NPM" active>
69
+
70
+
```bash:no-line-numbers
71
+
npm install
72
+
```
73
+
74
+
</CodeGroupItem>
75
+
</CodeGroup>
76
+
````
77
+
78
+
**Output**
79
+
80
+
<CodeGroup>
81
+
<CodeGroupItemtitle="YARN">
82
+
83
+
```bash:no-line-numbers
84
+
yarn
85
+
```
86
+
87
+
</CodeGroupItem>
88
+
89
+
<CodeGroupItemtitle="NPM"active>
90
+
91
+
```bash:no-line-numbers
92
+
npm install
93
+
```
94
+
95
+
</CodeGroupItem>
96
+
</CodeGroup>
97
+
98
+
:::warning
99
+
You must add an empty line between the starting tag of `<CodeGroupItem>` and the code fence, otherwise the code fence will not be parsed correctly by Markdown.
100
+
101
+
All content must be valid Markdown first, and then a Vue SFC.
102
+
103
+
Learn more: [Advanced > Markdown and Vue SFC](../../guide/advanced/markdown.md)
0 commit comments