mirror of https://github.com/Fabio286/antares.git
fix: flip not working on BaseIcon component
This commit is contained in:
parent
cb92ca99f6
commit
922f56f69b
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue