feat(checklist): show green progress circle when all checkboxes are done
This commit is contained in:
parent
80759831ec
commit
c4ec7f032f
|
|
@ -6,6 +6,7 @@
|
||||||
<svg
|
<svg
|
||||||
width="12"
|
width="12"
|
||||||
height="12"
|
height="12"
|
||||||
|
:class="{'is-all-done': allDone}"
|
||||||
>
|
>
|
||||||
<circle
|
<circle
|
||||||
stroke-width="2"
|
stroke-width="2"
|
||||||
|
|
@ -51,9 +52,11 @@ const checklistCircleDone = computed(() => {
|
||||||
return ((100 - progress) / 100) * c
|
return ((100 - progress) / 100) * c
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const allDone = computed(() => checklist.value.total === checklist.value.checked)
|
||||||
|
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
const label = computed(() => {
|
const label = computed(() => {
|
||||||
return checklist.value.total === checklist.value.checked
|
return allDone.value
|
||||||
? t('task.checklistAllDone', checklist.value)
|
? t('task.checklistAllDone', checklist.value)
|
||||||
: t('task.checklistTotal', checklist.value)
|
: t('task.checklistTotal', checklist.value)
|
||||||
})
|
})
|
||||||
|
|
@ -81,4 +84,10 @@ circle {
|
||||||
stroke: var(--primary);
|
stroke: var(--primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svg.is-all-done circle {
|
||||||
|
&:last-child {
|
||||||
|
stroke: var(--success);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue