File tree Expand file tree Collapse file tree
packages/rolldown/src/app/components/display Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,14 @@ const props = defineProps<{
77}>()
88
99const isNotChanged = computed (() => props .previous === props .current )
10- const normalizedPercent = computed (() => Math .abs ((props .current - props .previous ) / props .previous * 100 ).toFixed (isNotChanged .value ? 0 : 2 ))
10+ const normalizedPercent = computed (() => {
11+ if (isNotChanged .value )
12+ return ' 0'
13+ if (props .previous === 0 )
14+ return ' 100.00'
15+
16+ return Math .abs ((props .current - props .previous ) / props .previous * 100 ).toFixed (2 )
17+ })
1118const trendSymbol = computed (() => isNotChanged .value ? ' ' : (props .current > props .previous ? ' +' : ' -' ))
1219const comparisonColorClass = computed (() => isNotChanged .value ? ' text-gray-500' : (props .current > props .previous ? ' text-green-500' : ' text-red-500' ))
1320 </script >
You can’t perform that action at this time.
0 commit comments