set max default in props declaration
This commit is contained in:
parent
7b85b4df47
commit
98cc62a110
|
|
@ -11,6 +11,7 @@ const props = withDefaults(
|
|||
defineProps<ProgressRootProps & { class?: HTMLAttributes['class'] }>(),
|
||||
{
|
||||
modelValue: 0,
|
||||
max: 100
|
||||
},
|
||||
)
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ const delegatedProps = computed(() => {
|
|||
>
|
||||
<ProgressIndicator
|
||||
class="h-full w-full flex-1 bg-primary transition-all"
|
||||
:style="`transform: translateX(-${100 - (props.modelValue ?? 0) * 100 / (props.max ?? 100)}%);`"
|
||||
:style="`transform: translateX(-${100 - (props.modelValue ?? 0) * 100 / props.max}%);`"
|
||||
/>
|
||||
</ProgressRoot>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user