Skip to content

Commit 4507020

Browse files
committed
feat: add src prop
1 parent d8db172 commit 4507020

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CIcon.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<template>
22
<svg
3+
v-if="!src"
34
xmlns="http://www.w3.org/2000/svg"
45
:viewBox="viewBox"
56
:class="computedClasses"
67
v-html="icon.svgContent"
78
></svg>
9+
<img
10+
v-else
11+
:src="src"
12+
/>
813
</template>
914

1015
<script>
@@ -17,7 +22,8 @@ export default {
1722
type: String,
1823
validator: size => ['sm', 'lg', 'xl', 'custom-size'].includes(size)
1924
},
20-
customClasses: [String, Array, Object]
25+
customClasses: [String, Array, Object],
26+
src: String
2127
},
2228
computed: {
2329
iconName () {

index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export declare class CIcon extends Vue {
55
content: [string, Array<string>]
66
size: string
77
customClasses: [string, Array<any>, object]
8+
src: string
89
}

0 commit comments

Comments
 (0)