style: update icon size
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<component :is="icon" class="w-5 h-5" />
|
||||
<component :is="icon" :class="className" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -7,17 +7,22 @@ import { computed } from 'vue'
|
||||
import * as heroIcons from '@heroicons/vue/24/outline'
|
||||
|
||||
const props = defineProps({
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "w-5 h-5"
|
||||
}
|
||||
})
|
||||
|
||||
const icon = computed(() => {
|
||||
let name = ''
|
||||
props.name.split('-').forEach(v => {
|
||||
name += v[0].toUpperCase() + v.substr(1)
|
||||
})
|
||||
return heroIcons[name + 'Icon']
|
||||
let name = ''
|
||||
props.name.split('-').forEach(v => {
|
||||
name += v[0].toUpperCase() + v.substr(1)
|
||||
})
|
||||
return heroIcons[name + 'Icon']
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user