Skip to content

Commit

Permalink
fix(skeleton): fix item style (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Nov 15, 2023
1 parent 81b087b commit 3586ae4
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions packages/oruga-next/src/components/skeleton/Skeleton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, ref, type PropType } from "vue";
import { computed, type PropType } from "vue";
import { baseComponentProps } from "@/utils/SharedProps";
import { getOption } from "@/utils/config";
Expand Down Expand Up @@ -66,17 +66,11 @@ const props = defineProps({
]),
});
const rootRef = ref();
const itemStyle = computed(() =>
rootRef.value
? {
height: toCssDimension(rootRef.value.height),
width: toCssDimension(rootRef.value.width),
borderRadius: props.circle ? "50%" : null,
}
: {},
);
const itemStyle = computed(() => ({
height: toCssDimension(props.height),
width: toCssDimension(props.width),
borderRadius: props.circle ? "50%" : null,
}));
// --- Computed Component Classes ---
Expand Down Expand Up @@ -106,7 +100,7 @@ const itemClasses = computed(() => [
</script>

<template>
<div v-if="active" ref="rootRef" data-oruga="skeleton" :class="rootClasses">
<div v-if="active" data-oruga="skeleton" :class="rootClasses">
<div
v-for="i in count"
:key="i"
Expand Down

0 comments on commit 3586ae4

Please sign in to comment.