Skip to content
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

feat(PickerGroup): add new prop showToolbar #12839

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions packages/vant/src/picker-group/PickerGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
makeArrayProp,
makeNumericProp,
createNamespace,
truthProp,
} from '../utils';

// Composables
Expand All @@ -40,6 +41,7 @@ export const pickerGroupProps = extend(
tabs: makeArrayProp<string>(),
activeTab: makeNumericProp(0),
nextStepText: String,
showToolbar: truthProp,
},
pickerToolbarProps,
);
Expand Down Expand Up @@ -100,14 +102,16 @@ export default defineComponent({

return (
<div class={bem()}>
<Toolbar
v-slots={pick(slots, pickerToolbarSlots)}
title={props.title}
cancelButtonText={props.cancelButtonText}
confirmButtonText={confirmButtonText}
onConfirm={onConfirm}
onCancel={onCancel}
/>
{props.showToolbar ? (
<Toolbar
v-slots={pick(slots, pickerToolbarSlots)}
title={props.title}
cancelButtonText={props.cancelButtonText}
confirmButtonText={confirmButtonText}
onConfirm={onConfirm}
onCancel={onCancel}
/>
) : null}
<Tabs
v-model:active={activeTab.value}
class={bem('tabs')}
Expand Down
1 change: 1 addition & 0 deletions packages/vant/src/picker-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export default {
| v-model:active-tab `v4.3.2` | Set index of active tab | _number \| string_ | `0` |
| tabs | Titles of tabs | _string[]_ | `[]` |
| title | Toolbar title | _string_ | `''` |
| show-toolbar | Whether to show toolbar | _boolean_ | `true` |
| next-step-text `v4.0.8` | Text of next step button | _string_ | `''` |
| confirm-button-text | Text of confirm button | _string_ | `Confirm` |
| cancel-button-text | Text of cancel button | _string_ | `Cancel` |
Expand Down
1 change: 1 addition & 0 deletions packages/vant/src/picker-group/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ export default {
| v-model:active-tab `v4.3.2` | 设置当前选中的标签 | _number \| string_ | `0` |
| tabs | 设置标签页的标题 | _string[]_ | `[]` |
| title | 顶部栏标题 | _string_ | `''` |
| show-toolbar | 是否显示顶部栏 | _boolean_ | `true` |
| next-step-text `v4.0.8` | 下一步按钮的文字 | _string_ | `''` |
| confirm-button-text | 确认按钮的文字 | _string_ | `确认` |
| cancel-button-text | 取消按钮的文字 | _string_ | `取消` |
Expand Down
Loading