Skip to content

Commit 7fc1010

Browse files
refactor: use permalink with default value
1 parent fdf6cc8 commit 7fc1010

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

app/components/Package/TrendsChart.vue

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,33 @@ import type {
1616
YearlyDataPoint,
1717
} from '~/types/chart'
1818
19-
const props = defineProps<{
20-
// For single package downloads history
21-
weeklyDownloads?: WeeklyDataPoint[]
22-
inModal?: boolean
23-
24-
/**
25-
* Backward compatible single package mode.
26-
* Used when `weeklyDownloads` is provided.
27-
*/
28-
packageName?: string
29-
30-
/**
31-
* Multi-package mode.
32-
* Used when `weeklyDownloads` is not provided.
33-
*/
34-
packageNames?: string[]
35-
createdIso?: string | null
36-
37-
/** When true, shows facet selector (e.g. Downloads / Likes). */
38-
showFacetSelector?: boolean
39-
permalink?: boolean
40-
}>()
19+
const props = withDefaults(
20+
defineProps<{
21+
// For single package downloads history
22+
weeklyDownloads?: WeeklyDataPoint[]
23+
inModal?: boolean
24+
25+
/**
26+
* Backward compatible single package mode.
27+
* Used when `weeklyDownloads` is provided.
28+
*/
29+
packageName?: string
30+
31+
/**
32+
* Multi-package mode.
33+
* Used when `weeklyDownloads` is not provided.
34+
*/
35+
packageNames?: string[]
36+
createdIso?: string | null
37+
38+
/** When true, shows facet selector (e.g. Downloads / Likes). */
39+
showFacetSelector?: boolean
40+
permalink?: boolean
41+
}>(),
42+
{
43+
permalink: false,
44+
},
45+
)
4146
4247
const { locale } = useI18n()
4348
const { accentColors, selectedAccentColor } = useAccentColor()

0 commit comments

Comments
 (0)