From 93b3878827e4b4b54c1138397c6771767ffe3588 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 11 Aug 2022 21:07:01 +0200 Subject: [PATCH 1/2] Add styleguide example for single button icon using attr Signed-off-by: Vincent Petry --- src/components/ActionButton/ActionButton.vue | 27 ++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/components/ActionButton/ActionButton.vue b/src/components/ActionButton/ActionButton.vue index 429e4bf50c..037bb8ebee 100644 --- a/src/components/ActionButton/ActionButton.vue +++ b/src/components/ActionButton/ActionButton.vue @@ -69,9 +69,6 @@ If you're using a long text you can specify a title + +``` + You can also use a custom icon, for example from the vue-material-design-icons library: ```vue From 29961159da72335398eea15a273638149ac7718c Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 11 Aug 2022 21:45:13 +0200 Subject: [PATCH 2/2] Use icon attr in single inline action button Signed-off-by: Vincent Petry --- src/components/Actions/Actions.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Actions/Actions.vue b/src/components/Actions/Actions.vue index bc8887d841..df0c3c60cd 100644 --- a/src/components/Actions/Actions.vue +++ b/src/components/Actions/Actions.vue @@ -739,6 +739,8 @@ export default { 'action-item action-item--single', firstAction?.data?.staticClass, firstAction?.data?.class, + // use icon attribute as class if icon slot is not used + icon ? undefined : firstAction?.componentOptions?.propsData?.icon, ], attrs: { 'aria-label': firstAction?.componentOptions?.propsData?.ariaLabel || firstAction?.componentOptions?.children?.[0]?.text,