Snippet / 片段
显示可拷贝的命令行代码片段。
基础的
展示一个命令。
宽度
手动地指定宽度。
类型
以颜色区分不同的类型。
多行
无拷贝
隐藏拷贝按钮。 (禁用拷贝)
填充
APIs / 接口文档
Snippet.Props
属性 | 描述 | 类型 | 推荐值 | 默认 |
---|---|---|---|---|
text | 命令文本 | string Array<string> | - | - |
type | 组件类型 | SnippetTypes | SnippetTypes | default |
filled | 填充风格的样式 | boolean | - | false |
width | 设置 CSS 宽度 | string | - | initial |
copy | 拷贝按钮的工作方式 | CopyTypes | CopyTypes | default |
symbol | 组件左侧显示的字符 | string | - | $ |
toastText | 拷贝提示的字符 | string | - | Copied to clipboard! |
toastType | 拷贝提示的类型 | ToastTypes | ToastTypes | success |
... | 原生属性 | HTMLAttributes | 'id', 'name', ... | - |
SnippetTypes
type SnippetTypes =
| 'default'
| 'secondary'
| 'success'
| 'warning'
| 'error'
| 'dark'
| 'lite'
CopyTypes
type CopyTypes = 'default' | 'silent' | 'prevent'
SnippetTypes
type SnippetTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
ToastTypes
type ToastTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
文档贡献者