mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: flip not working on BaseIcon component
This commit is contained in:
@ -3,8 +3,8 @@
|
|||||||
:type="type"
|
:type="type"
|
||||||
:path="iconPath"
|
:path="iconPath"
|
||||||
:size="size"
|
:size="size"
|
||||||
:flip="flip"
|
|
||||||
:rotate="rotate"
|
:rotate="rotate"
|
||||||
|
:class="iconFlip"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -39,4 +39,25 @@ const props = defineProps({
|
|||||||
const iconPath = computed(() => {
|
const iconPath = computed(() => {
|
||||||
return (Icons as {[k:string]: string})[props.iconName];
|
return (Icons as {[k:string]: string})[props.iconName];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const iconFlip = computed(() => {
|
||||||
|
if (['horizontal', 'vertical', 'both'].includes(props.flip))
|
||||||
|
return `flip-${props.flip}`;
|
||||||
|
else return '';
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.flip-horizontal {
|
||||||
|
transform: scaleX(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.flip-vertical {
|
||||||
|
transform: scaleY(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.flip-both {
|
||||||
|
/* flip both */
|
||||||
|
transform: scale(-1, -1);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Reference in New Issue
Block a user