mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Area): add columns-top、columns-bottom prop (#5719)
This commit is contained in:
parent
7344389535
commit
064cff6fe0
@ -84,6 +84,8 @@ Set `columns-num` with 2, you'll have a 2 level picker.
|
|||||||
| Name | Description |
|
| Name | Description |
|
||||||
|------|------|
|
|------|------|
|
||||||
| title `v2.5.3` | Custom title |
|
| title `v2.5.3` | Custom title |
|
||||||
|
| columns-top `v2.5.3` | Custom content above columns |
|
||||||
|
| columns-bottom `v2.5.3` | Custom content below columns |
|
||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
|
@ -83,6 +83,8 @@ Vue.use(Area);
|
|||||||
| 名称 | 说明 |
|
| 名称 | 说明 |
|
||||||
|------|------|
|
|------|------|
|
||||||
| title `v2.5.3` | 自定义标题内容 |
|
| title `v2.5.3` | 自定义标题内容 |
|
||||||
|
| columns-top `v2.5.3` | 自定义选项上方内容 |
|
||||||
|
| columns-bottom `v2.5.3` | 自定义选项下方内容 |
|
||||||
|
|
||||||
### 方法
|
### 方法
|
||||||
|
|
||||||
|
@ -305,7 +305,11 @@ export default createComponent({
|
|||||||
visibleItemCount={this.visibleItemCount}
|
visibleItemCount={this.visibleItemCount}
|
||||||
cancelButtonText={this.cancelButtonText}
|
cancelButtonText={this.cancelButtonText}
|
||||||
confirmButtonText={this.confirmButtonText}
|
confirmButtonText={this.confirmButtonText}
|
||||||
scopedSlots={pickSlots(this, ['title'])}
|
scopedSlots={pickSlots(this, [
|
||||||
|
'title',
|
||||||
|
'columns-top',
|
||||||
|
'columns-bottom',
|
||||||
|
])}
|
||||||
{...{ on }}
|
{...{ on }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -114,6 +114,26 @@ exports[`columns-num prop 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`columns-top、columns-bottom slot 1`] = `
|
||||||
|
<div class="van-picker van-area">
|
||||||
|
<div class="van-hairline--top-bottom van-picker__toolbar"><button type="button" class="van-picker__cancel">取消</button><button type="button" class="van-picker__confirm">确认</button></div>
|
||||||
|
<!---->Top<div class="van-picker__columns" style="height: 220px;">
|
||||||
|
<div class="van-picker-column">
|
||||||
|
<ul class="van-picker-column__wrapper" style="transform: translate3d(0, 88px, 0); transition-duration: 0ms; transition-property: none; line-height: 44px;"></ul>
|
||||||
|
</div>
|
||||||
|
<div class="van-picker-column">
|
||||||
|
<ul class="van-picker-column__wrapper" style="transform: translate3d(0, 88px, 0); transition-duration: 0ms; transition-property: none; line-height: 44px;"></ul>
|
||||||
|
</div>
|
||||||
|
<div class="van-picker-column">
|
||||||
|
<ul class="van-picker-column__wrapper" style="transform: translate3d(0, 88px, 0); transition-duration: 0ms; transition-property: none; line-height: 44px;"></ul>
|
||||||
|
</div>
|
||||||
|
<div class="van-picker__mask" style="background-size: 100% 88px;"></div>
|
||||||
|
<div class="van-hairline-unset--top-bottom van-picker__frame" style="height: 44px;"></div>
|
||||||
|
</div>Bottom
|
||||||
|
<!---->
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`reset method 1`] = `
|
exports[`reset method 1`] = `
|
||||||
<div class="van-picker van-area">
|
<div class="van-picker van-area">
|
||||||
<div class="van-hairline--top-bottom van-picker__toolbar"><button type="button" class="van-picker__cancel">取消</button><button type="button" class="van-picker__confirm">确认</button></div>
|
<div class="van-hairline--top-bottom van-picker__toolbar"><button type="button" class="van-picker__cancel">取消</button><button type="button" class="van-picker__confirm">确认</button></div>
|
||||||
|
@ -139,3 +139,15 @@ test('title slot', async () => {
|
|||||||
await later();
|
await later();
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('columns-top、columns-bottom slot', async () => {
|
||||||
|
const wrapper = mount(Area, {
|
||||||
|
slots: {
|
||||||
|
'columns-top': 'Top',
|
||||||
|
'columns-bottom': 'Bottom',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await later();
|
||||||
|
expect(wrapper).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
@ -288,6 +288,8 @@ Picker events will pass different parameters according to the columns are single
|
|||||||
|------|------|
|
|------|------|
|
||||||
| default | Custom toolbar content |
|
| default | Custom toolbar content |
|
||||||
| title | Custom title |
|
| title | Custom title |
|
||||||
|
| columns-top | Custom content above columns |
|
||||||
|
| columns-bottom | Custom content below columns |
|
||||||
|
|
||||||
### Data Structure of Column
|
### Data Structure of Column
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user