From 3c1215d136e081256d6cea20c63127d1871a7256 Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Wed, 27 Sep 2023 14:12:42 +1000 Subject: [PATCH] feat(#7): add support for custom svgs --- src/components/Icon.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Icon.vue b/src/components/Icon.vue index 1fddff6..54cb122 100644 --- a/src/components/Icon.vue +++ b/src/components/Icon.vue @@ -5,7 +5,7 @@ 'ct-icon': true, [`ct-icon--size-${size}`]: size }" - :is="svg" + :is="svgData" role="img" /> @@ -17,6 +17,10 @@ export default { Type: String, default: undefined }, + svg: { + type: Object, + default: undefined + }, symbol: { type: String, default: 'account' @@ -28,7 +32,9 @@ export default { }, computed: { - svg: ({ symbol }) => () => import(`civictheme/assets/icons/${symbol}.svg?inline`) + svgData: ({ svg, symbol }) => () => svg + ? svg + : import(`civictheme/assets/icons/${symbol}.svg?inline`) }, }