From 2fec57847d3cc9182b0222155620fbf9cc5736f3 Mon Sep 17 00:00:00 2001 From: Vitaly Raicheu Date: Thu, 7 Apr 2022 16:05:34 +0300 Subject: [PATCH] [#1625] Fix breadcrumbs router error (#1627) * feat: use ExtractPropType in useRouterLink * fix: add deprecated comment to mixins * fix: error in isDisabled, minor updates * feat: add demo example with vertical breadcrumbs * fix: brought back some changes, add extra comment Co-authored-by: Vitaly Raicheu --- .../va-breadcrumbs/VaBreadcrumbs.demo.vue | 10 ++++++++++ .../components/va-breadcrumbs/VaBreadcrumbs.vue | 6 ++++-- .../VaBreadcrumbsItem/VaBreadcrumbsItem.vue | 4 +++- packages/ui/src/composables/useRouterLink.ts | 16 ++-------------- packages/ui/src/mixins/AlignMixin.ts | 1 + .../ClickOutsideMixin/ClickOutsideMixin.ts | 1 + .../ui/src/mixins/LoadingMixin/LoadingMixin.ts | 1 + .../mixins/RouterLinkMixin/RouterLinkMixin.ts | 1 + .../ui/src/mixins/ScrollMixin/ScrollMixin.ts | 1 + .../mixins/SelectableList/SelectableListMixin.ts | 1 + .../mixins/SelectableMixin/SelectableMixin.ts | 1 + packages/ui/src/mixins/SizeMixin.ts | 1 + .../ui/src/mixins/StatefulMixin/StatefulMixin.ts | 1 + .../src/mixins/StatefulMixin/cStatefulMixin.ts | 1 + .../ui/src/services/color-config/ColorMixin.ts | 1 + 15 files changed, 30 insertions(+), 17 deletions(-) diff --git a/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.demo.vue b/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.demo.vue index 0329c119b75..a642ff83bf2 100644 --- a/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.demo.vue +++ b/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.demo.vue @@ -75,6 +75,16 @@ + + + + + + + + Color: diff --git a/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.vue b/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.vue index aff9bccd2ca..fcd9a36a3fe 100644 --- a/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.vue +++ b/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbs.vue @@ -35,8 +35,10 @@ export default defineComponent({ } const createSeparatorComponent = () => { - // Temp fix for https://github.com/vuejs/vue-next/issues/3666. Move `separatorNode` outside this method. - const separatorNode = (slots.separator ? slots.separator() : 0) || [props.separator] + // Temp fix for https://github.com/intlify/vue-i18n-next/issues/412 + // `separatorNode` can be moved outside this method after update vuestic's minimal vue version to 3.1.0 + // testing: have to monitor errors after leaving breadcrumbs page in doc + const separatorNode = slots.separator ? slots.separator() : [props.separator] return h('span', { class: ['va-breadcrumbs__separator'], diff --git a/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbsItem/VaBreadcrumbsItem.vue b/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbsItem/VaBreadcrumbsItem.vue index dc8bf63912d..121d3d0eedb 100644 --- a/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbsItem/VaBreadcrumbsItem.vue +++ b/packages/ui/src/components/va-breadcrumbs/VaBreadcrumbsItem/VaBreadcrumbsItem.vue @@ -35,7 +35,7 @@ export default defineComponent({ setup: (props) => { const { hasRouterLinkParams, hrefComputed } = useRouterLink(props) - const isDisabled = computed(() => props.disabled || hasRouterLinkParams.value) + const isDisabled = computed(() => props.disabled || !hasRouterLinkParams.value) return { isDisabled, hrefComputed } }, @@ -43,6 +43,8 @@ export default defineComponent({