-
Notifications
You must be signed in to change notification settings - Fork 7
Add option to show a back button to Navigation and View components #51
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,9 +12,11 @@ | |
| class="c-view__navigation" | ||
| :assistive-title="assistiveTitle" | ||
| :current-tab="activeTab" | ||
| :show-back-button="showBackButton ? '' : null" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Figuring this out took me like 2 hours. Turns out that boolean properties that are passed down need to be properly casted as boolean arguments (like the disabled HTML argument), otherwise they are casted to a string and everything breaks 🥲. See vuejs/docs#1972 (comment) and the related playground for more info. |
||
| :title="title" | ||
| .tabs="tabs" | ||
| @click-tab="setCurrentTab" | ||
| @go-back="$emit('go-back')" | ||
| > | ||
| <slot name="tabs" /> | ||
| <!-- eslint-disable-next-line vue/no-deprecated-slot-attribute --> | ||
|
|
@@ -80,8 +82,15 @@ export default { | |
| type: Array, | ||
| default: () => [], | ||
| }, | ||
|
|
||
| showBackButton: { | ||
| type: Boolean, | ||
| default: false, | ||
| }, | ||
| }, | ||
|
|
||
| emits: ['go-back'], | ||
|
|
||
| data: () => ({ | ||
| activeTab: '', | ||
| }), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to use our toolkit button here? or it's better to use just the default one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went for the HTML button for ease of use, since it is easier to style. Would be trickier to do so with the toolkit button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be good to consider some way for the future to make the toolkit button usable in those cases, or just drop it for the HTML one 😜