mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-10-07 17:29:58 +08:00
[new feature] Tabbar: add border prop
This commit is contained in:
parent
a6b60c2a55
commit
ead802d9f1
@ -162,6 +162,7 @@
|
|||||||
### Tabbar
|
### Tabbar
|
||||||
|
|
||||||
- 新增`route`属性
|
- 新增`route`属性
|
||||||
|
- 新增`border`属性
|
||||||
- 新增`inactive-color`属性
|
- 新增`inactive-color`属性
|
||||||
|
|
||||||
### TabbarItem
|
### TabbarItem
|
||||||
|
@ -142,6 +142,7 @@ export default {
|
|||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| v-model | Identifier of current tab | `String | Number` | `0` |
|
| v-model | Identifier of current tab | `String | Number` | `0` |
|
||||||
| fixed | Whether to fixed bottom | `Boolean` | `true` |
|
| fixed | Whether to fixed bottom | `Boolean` | `true` |
|
||||||
|
| border | Whether to show border | `Boolean` | `true` |
|
||||||
| z-index | Z-index | `Number` | `1` |
|
| z-index | Z-index | `Number` | `1` |
|
||||||
| active-color | Color of active tab item | `String` | `#1989fa` |
|
| active-color | Color of active tab item | `String` | `#1989fa` |
|
||||||
| inactive-color | Color of inactive tab item | `String` | `#7d7e80` |
|
| inactive-color | Color of inactive tab item | `String` | `#7d7e80` |
|
||||||
|
@ -15,6 +15,10 @@ export default sfc({
|
|||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
|
border: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
fixed: {
|
fixed: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
@ -55,7 +59,7 @@ export default sfc({
|
|||||||
<div
|
<div
|
||||||
style={{ zIndex: this.zIndex }}
|
style={{ zIndex: this.zIndex }}
|
||||||
class={[
|
class={[
|
||||||
'van-hairline--top-bottom',
|
{ 'van-hairline--top-bottom': this.border },
|
||||||
bem({
|
bem({
|
||||||
fixed: this.fixed,
|
fixed: this.fixed,
|
||||||
'safe-area-inset-bottom': this.safeAreaInsetBottom
|
'safe-area-inset-bottom': this.safeAreaInsetBottom
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`disable border 1`] = `<div class="van-tabbar van-tabbar--fixed" style="z-index: 1;"></div>`;
|
||||||
|
|
||||||
exports[`route mode 1`] = `
|
exports[`route mode 1`] = `
|
||||||
<div class="van-hairline--top-bottom van-tabbar van-tabbar--fixed" style="z-index: 1;">
|
<div class="van-hairline--top-bottom van-tabbar van-tabbar--fixed" style="z-index: 1;">
|
||||||
<div class="van-tabbar-item van-tabbar-item--active">
|
<div class="van-tabbar-item van-tabbar-item--active">
|
||||||
|
@ -112,3 +112,13 @@ test('name prop', () => {
|
|||||||
|
|
||||||
expect(onChange).toHaveBeenCalledWith('b');
|
expect(onChange).toHaveBeenCalledWith('b');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('disable border', () => {
|
||||||
|
const wrapper = mount(Tabbar, {
|
||||||
|
propsData: {
|
||||||
|
border: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(wrapper).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
@ -148,6 +148,7 @@ export default {
|
|||||||
|------|------|------|------|------|
|
|------|------|------|------|------|
|
||||||
| v-model | 当前选中标签的名称或索引值 | `String | Number` | `0` | - |
|
| v-model | 当前选中标签的名称或索引值 | `String | Number` | `0` | - |
|
||||||
| fixed | 是否固定在底部 | `Boolean` | `true` | - |
|
| fixed | 是否固定在底部 | `Boolean` | `true` | - |
|
||||||
|
| border | 是否显示外边框 | `Boolean` | `true` | 2.0.0 |
|
||||||
| z-index | 元素 z-index | `Number` | `1` | 1.1.9 |
|
| z-index | 元素 z-index | `Number` | `1` | 1.1.9 |
|
||||||
| active-color | 选中标签的颜色 | `String` | `#1989fa` | 1.5.1 |
|
| active-color | 选中标签的颜色 | `String` | `#1989fa` | 1.5.1 |
|
||||||
| inactive-color | 未选中标签的颜色 | `String` | `#7d7e80` | 2.0.0 |
|
| inactive-color | 未选中标签的颜色 | `String` | `#7d7e80` | 2.0.0 |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user