mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
57 lines
902 B
Vue
57 lines
902 B
Vue
|
<template functional>
|
||
|
<component
|
||
|
:is="$options.components.FontAwesomeIcon"
|
||
|
:class="$style[`_${props.size}`]"
|
||
|
:icon="props.icon"
|
||
|
:spin="props.spin"
|
||
|
/>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||
|
|
||
|
export default {
|
||
|
name: 'n8n-icon',
|
||
|
components: {
|
||
|
FontAwesomeIcon,
|
||
|
},
|
||
|
props: {
|
||
|
icon: {
|
||
|
type: String,
|
||
|
required: true,
|
||
|
},
|
||
|
size: {
|
||
|
type: String,
|
||
|
default: 'medium',
|
||
|
validator: function (value: string): boolean {
|
||
|
return ['small', 'medium', 'large'].indexOf(value) !== -1;
|
||
|
},
|
||
|
},
|
||
|
spin: {
|
||
|
type: Boolean,
|
||
|
default: false,
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" module>
|
||
|
._small {
|
||
|
font-size: 0.85em;
|
||
|
height: 0.85em;
|
||
|
width: 0.85em !important;
|
||
|
}
|
||
|
|
||
|
._medium {
|
||
|
font-size: 0.95em;
|
||
|
height: 0.95em;
|
||
|
width: 0.95em !important;
|
||
|
}
|
||
|
|
||
|
._large {
|
||
|
font-size: 1.22em;
|
||
|
height: 1.22em;
|
||
|
width: 1.22em !important;
|
||
|
}
|
||
|
</style>
|