You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
507 B
27 lines
507 B
![]()
2 years ago
|
<template>
|
||
|
<i class="text-xl/4" :class="iconClass"/>
|
||
|
</template>
|
||
|
|
||
|
<script setup>
|
||
|
import {computed} from "vue";
|
||
|
import {chamiloIconToClass} from "./ChamiloIcons";
|
||
|
|
||
|
|
||
|
const props = defineProps({
|
||
|
icon: {
|
||
|
type: String,
|
||
|
required: true,
|
||
|
validator: (value) => {
|
||
|
if (typeof (value) !== "string") {
|
||
|
return false
|
||
|
}
|
||
|
return Object.keys(chamiloIconToClass).includes(value)
|
||
|
}
|
||
|
},
|
||
|
});
|
||
|
|
||
|
const iconClass = computed(() => {
|
||
|
return chamiloIconToClass[props.icon];
|
||
|
});
|
||
|
</script>
|