+
import tabs from '~widgets/tabs/widget.vue';
+import icon from '~widgets/icon/widget.vue';
import registerWidget from '~core/registerWidget';
registerWidget('ui-tabs', tabs);
+registerWidget('ui-icon', icon);
export default {
props: {
@@ -67,7 +80,14 @@ export default {
type: String,
default: '',
},
+
+ showBackButton: {
+ type: Boolean,
+ default: false,
+ },
},
+
+ emits: ['go-back'],
};
@@ -129,6 +149,25 @@ export default {
align-items: center;
flex: 0 0 auto;
}
+
+ &__back-button {
+ height: 36px;
+ width: 36px;
+ margin: 0 24px 0 -8px;
+ padding: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: 0;
+ outline: none;
+ border-radius: 2px;
+ background-color: transparent;
+ cursor: pointer;
+
+ &:hover {
+ background-color: #e0e0e0;
+ }
+ }
}
.page-title {
diff --git a/components/src/widgets/view/widget.vue b/components/src/widgets/view/widget.vue
index 3804628e..bec5ae92 100644
--- a/components/src/widgets/view/widget.vue
+++ b/components/src/widgets/view/widget.vue
@@ -12,9 +12,11 @@
class="c-view__navigation"
:assistive-title="assistiveTitle"
:current-tab="activeTab"
+ :show-back-button="showBackButton ? '' : null"
:title="title"
.tabs="tabs"
@click-tab="setCurrentTab"
+ @go-back="$emit('go-back')"
>
@@ -80,8 +82,15 @@ export default {
type: Array,
default: () => [],
},
+
+ showBackButton: {
+ type: Boolean,
+ default: false,
+ },
},
+ emits: ['go-back'],
+
data: () => ({
activeTab: '',
}),