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