index/components/ui/XIcon.vue

53 lines
905 B
Vue

<script setup lang="ts">
import 'iconify-icon'
import type { IconifyRenderMode } from 'iconify-icon'
import type { PropType } from 'vue'
const props = defineProps({
name: {
type: String,
required: true,
},
mode: {
type: String as PropType<IconifyRenderMode>,
default: 'svg',
},
inline: {
type: Boolean,
default: false,
},
width: {
type: String,
default: '1em',
},
height: {
type: String,
default: '1em',
},
flip: {
type: String,
default: '',
},
rotate: {
type: [String, Number],
default: '',
},
})
const icon = props.name?.split(':')?.[0] === 'local' ?
</script>
<template>
<iconify-icon
:icon="props.name"
:mode="props.mode"
:inline="props.inline"
:width="props.width"
:height="props.height"
:flip="props.flip"
:rotate="props.rotate"
/>
</template>
<style scoped lang="scss"></style>