TS接口文档可以查看同文件夹下的types.ts
Props
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| data | 源分支和目标分支的数据 | BranchCompareData | — | {} |
| repoList | 仓库下拉数据项 | {label: string; value: string | number}[] | — |
| branchList | 对应仓库下分支的下拉数据项 | {label: string; value: string | number}[] | — |
| repoIcon? | 仓库对应图标 | string | — | 'version-history' |
| branchIcon? | 分支对应图标 | string | — | 'branch-merge' |
| repoIconSize? | 仓库图标尺寸 | string | — | '16px' |
| branchIconSize? | 分支图标尺寸 | string | — | '16px' |
Emits
注意:以下事件都是组件内部对应的按钮点击触发,如果用插槽自定义对应区域的内容的话,事件自行监听即可
| 方法 | 说明 | 返回值 |
|---|---|---|
| repoChange | 仓库变化 | string |
| branchChange | 分支变化 | { sourceId: string |
Slots
| 名称 | 说明 |
|---|---|
| source-header | 源分支头部插槽 |
| repo-option | 仓库下拉option插槽 |
| source-option | 源分支下拉option插槽 |
| switch | 中间切换按钮插槽 |
| target-header | 目标分支头部插槽 |
| target-option | 源分支下拉option插槽 |
| repo-prefix | 仓库输入框部分前缀图标插槽 |
| branch-prefix | 分支输入框部分前缀图标插槽 |
| source-tip | 源分支底部信息插槽 |
| target-tip | 目标分支底部信息插槽 |