选项卡
选项卡组件由两个短代码组成:
{{< tabs >}}
{{< tab name="name of the tab" >}}
短{{< tabs >}}
代码是一个父组件,包装了许多tabs
.每个都{{< tab >}}
使用属性指定一个名称name
。
您可以选择group
为包装器指定一个属性tabs
,以指示选项卡部分应属于一组选项卡。请参阅
组。
例子
console.log("hello world")
fmt.Println("hello world")
标记
{{< tabs >}}
{{< tab name="JavaScript" >}}
```js
console.log("hello world")
```
{{< /tab >}}
{{< tab name="Go" >}}
```go
fmt.Println("hello world")
```
{{< /tab >}}
{{< /tabs >}}
团体
您可以选择在短代码上指定选项卡组tabs
。这样做将同步属于同一组的所有选项卡的选项卡选择。
选项卡组示例
以下示例显示属于同一组的两个选项卡部分。
console.log("hello world")
fmt.Println("hello world")
const res = await fetch("/users/1")
resp, err := http.Get("/users/1")