Snippet / 片段

显示可拷贝的命令行代码片段。

基础的

展示一个命令。

宽度

手动地指定宽度。

类型

以颜色区分不同的类型。

多行

无拷贝

隐藏拷贝按钮。 (禁用拷贝)

填充

APIs / 接口文档

Snippet.Props

属性描述类型推荐值默认
text命令文本string Array<string>--
type组件类型SnippetTypesSnippetTypesdefault
filled填充风格的样式boolean-false
width设置 CSS 宽度string-initial
copy拷贝按钮的工作方式CopyTypesCopyTypesdefault
symbol组件左侧显示的字符string-$
toastText拷贝提示的字符string-Copied to clipboard!
toastType拷贝提示的类型ToastTypesToastTypessuccess
...原生属性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'