-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[comp: tabs]: add component tabs #195
Comments
@danranVm 请review |
|
@danranVm @LaamGinghong 统一更改为 |
这个API放在父组件的原因仅仅是在于:
|
这个我觉得没有必要,因为子组件有disabled |
我的想法是按需渲染,不存在隐藏的时候会渲染的情况。 如果需要隐藏状态下全部渲染,要重新调整API |
Tabs API
What problem does this feature solve?用于需要进行页面选项卡切换,又不希望进行路由切换。 What does the proposed API look like?
API
|
名称 | 说明 | 类型 | 默认值 | 全局配置 | 备注 |
---|---|---|---|---|---|
active | v-model |
当前聚焦的 tab | any |
第一个 tab 的 value | - | - |
type |
选项卡的样式 | line | card |
line |
✅ | - |
closable |
选项卡是否可关闭 | boolean |
false |
✅ | - |
size |
选项卡大小 | small | medium | large |
medium |
✅ | - |
tabPosition |
选项卡位置 | top | left |
top |
- | - |
tabGutter |
选项卡之间间隙 | number |
0 | ✅ | 当且仅当 type = card 时才生效 |
memo |
选项卡缓存 | boolean |
false |
- | - |
Emits
名称 | 说明 | 类型 |
---|---|---|
click |
点击选项卡回调 | (active: any, event: MouseEvent) => void |
close |
点击选项卡关闭按钮回调 | (active: any) => void |
Slots
名称 | 说明 |
---|---|
default |
选项卡 |
leftExtra |
左操作区 |
rightExtra |
右操作区 |
ix-tab
Props
名称 | 说明 | 类型 | 默认值 | 全局配置 | 备注 |
---|---|---|---|---|---|
value |
选项卡唯一值 | any |
- | - | 请保证同级别唯一,会作为 key 使用 |
disabled |
是否禁用选项卡 | boolean |
false |
- | 无法切换到已禁用的选项卡,若通过数据进行切换,会自动切换回第一个可以切换的选项卡 |
title |
选项卡标题 | string |
- | - | - |
memo |
是否缓存当前选项卡 | boolean |
false |
- | - |
Slots
名称 | 说明 |
---|---|
default |
选项卡内容 |
title |
选项卡标题 |
@danranVm 重新设计了API |
Tabs API
What problem does this feature solve?
用于需要进行页面选项卡切换,又不希望进行路由切换。
What does the proposed API look like?
left-extra
和right-extra
两个插槽;何时使用
需要进行tab切换,又不希望进行路由跳转时。
API
ix-tabs
Props
active | v-model
any
type
card | line
closable
boolean
size
small | large
position
left | top
top
showAdd
boolean
tabGutter
number
memo
boolean
Emits
change
(active: any) => void
clickTab
(active: any, event: MouseEvent) => void
clickClose
(active: any) => void
clickAdd
() => void
Slots
default
leftExtra
rightExtra
ix-tab
Props
value
any
disabled
boolean
label
string | v-slot: label
showClose
boolean
memo
boolean
Slots
default
The text was updated successfully, but these errors were encountered: