diff --git a/src/components/FontAwesomeIcon/index.vue b/src/components/FontAwesomeIcon/index.vue index 97c83cb..89a7037 100644 --- a/src/components/FontAwesomeIcon/index.vue +++ b/src/components/FontAwesomeIcon/index.vue @@ -11,44 +11,13 @@ */ import { FontAwesomeIconProps } from '@/components/FontAwesomeIcon/props'; const props = defineProps(FontAwesomeIconProps); - defineExpose({ stack: props.stack }); - const wrapClassObject = [ - props.float ? `fa-pull-${props.float}` : '', - props.border ? 'fa-border' : '', - props.stack ? 'fa-stack' : '', - props.stackChild ? `fa-stack-${props.stackX}x` : '', - props.stackInverse ? 'fa-inverse' : '', - ]; - - const wrapStyleObject = Object.assign( - { - 'background-color': props.bgColor, - }, - props.border - ? { - '--fa-border-color': props.borderConfig?.color || '#eee', - '--fa-border-padding': props.borderConfig?.padding || '.04em .26em', - '--fa-border-radius': props.borderConfig?.radius || '.1em', - '--fa-border-style': props.borderConfig?.style || 'solid', - '--fa-border-width': props.borderConfig?.width || '.08em', - } - : {}, - props.float - ? { - '--fa-pull-margin': props.pullMargin, - } - : {}, - ); const singleBeat = props.beat && !props.fade; const singleFade = !props.beat && props.fade; const BeatFade = props.beat && props.fade; - - const iconClassObject = [ - `fa-${props.mode}`, - `fa-${props.name}`, - props.frameSize ? `fa-flip-${props.frameSize}` : '', - props.sharp ? 'fass' : '', + const wrapClassObject = [ + props.float ? `fa-pull-${props.float}` : '', + props.border ? 'fa-border' : '', props.rotate ? 'fa-rotate-by' : '', props.rotateFlip ? `fa-flip-${props.rotateFlip}` : '', singleBeat ? `fa-beat` : '', @@ -60,11 +29,14 @@ props.spin ? 'fa-spin' : '', props.spinReverse ? 'fa-spin-reverse' : '', props.spinPulse ? 'fa-spin-pulse' : '', + props.stack ? 'fa-stack' : '', + props.stackChild ? `fa-stack-${props.stackX}x` : '', + props.stackInverse ? 'fa-inverse' : '', ]; - const iconStyleObject = Object.assign( + + const wrapStyleObject = Object.assign( { - color: props.color, - 'font-size': props.size ? `${props.size}rpx` : false, + 'background-color': props.bgColor, '--fa-animation-duration': `${props.duration}s`, }, props.rotate ? { '--fa-rotate-angle': `${props.rotate}deg` } : {}, @@ -100,7 +72,42 @@ '--fa-animation-timing': props.spinTiming, } : {}, + props.border + ? { + '--fa-border-color': props.borderConfig?.color || '#eee', + '--fa-border-padding': props.borderConfig?.padding || '.04em .26em', + '--fa-border-radius': props.borderConfig?.radius || '.1em', + '--fa-border-style': props.borderConfig?.style || 'solid', + '--fa-border-width': props.borderConfig?.width || '.08em', + } + : {}, + props.float + ? { + '--fa-pull-margin': props.pullMargin, + } + : {}, + props.stackChild + ? { + '--fa-stack-z-index': props.stackZIndex, + } + : {}, + props.stackChild && props.stackInverse + ? { + '--fa-inverse': props.stackInverseColor, + } + : {}, ); + + const iconClassObject = [ + `fa-${props.mode}`, + `fa-${props.name}`, + props.frameSize ? `fa-flip-${props.frameSize}` : '', + props.sharp ? 'fass' : '', + ]; + const iconStyleObject = Object.assign({ + color: props.color, + 'font-size': props.size ? `${props.size}rpx` : false, + });