From 340e6a82e53a3530b02b8d516793c600f7ac6b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 30 Aug 2023 09:40:37 +0300 Subject: [PATCH] Refactor #4351 - For Dock --- components/lib/dock/Dock.vue | 5 +++++ components/lib/dock/DockSub.vue | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/components/lib/dock/Dock.vue b/components/lib/dock/Dock.vue index a165274ef..cb8fdc461 100644 --- a/components/lib/dock/Dock.vue +++ b/components/lib/dock/Dock.vue @@ -23,6 +23,11 @@ import DockSub from './DockSub.vue'; export default { name: 'Dock', extends: BaseDock, + beforeMount() { + if (!this.$slots.item) { + console.warn('In future versions, vue-router support will be removed. Item templating should be used.'); + } + }, computed: { containerClass() { return [this.class, this.cx('root')]; diff --git a/components/lib/dock/DockSub.vue b/components/lib/dock/DockSub.vue index 989264a51..6e3f3ae92 100644 --- a/components/lib/dock/DockSub.vue +++ b/components/lib/dock/DockSub.vue @@ -64,7 +64,7 @@ - + @@ -275,6 +275,24 @@ export default { }, disabled(item) { return typeof item.disabled === 'function' ? item.disabled() : item.disabled; + }, + getMenuItemProps(item, index) { + return { + action: mergeProps( + { + tabindex: -1, + 'aria-hidden': true, + class: this.cx('action') + }, + this.getPTOptions('action', item, index) + ), + icon: mergeProps( + { + class: [this.cx('icon'), item.icon] + }, + this.getPTOptions('icon', item, index) + ) + }; } }, computed: {