@@ -10,7 +10,6 @@ definePageMeta({
1010
1111const { locale } = useI18n ()
1212const { copied, copy } = useClipboard ({ copiedDuring: 2000 })
13- const maxPackages = 4
1413
1514// Sync packages with URL query param (stable ref - doesn't change on other query changes)
1615const packagesParam = useRouteQuery <string >(' packages' , ' ' , { mode: ' replace' })
@@ -23,7 +22,7 @@ const packages = computed({
2322 .split (' ,' )
2423 .map (p => p .trim ())
2524 .filter (p => p .length > 0 )
26- .slice (0 , maxPackages )
25+ .slice (0 , MAX_PACKAGE_SELECTION )
2726 },
2827 set(value ) {
2928 packagesParam .value = value .length > 0 ? value .join (' ,' ) : ' '
@@ -61,12 +60,12 @@ const gridColumns = computed(() =>
6160
6261// Whether we can add the no-dep column (not already added and have room)
6362const canAddNoDep = computed (
64- () => packages .value .length < maxPackages && ! packages .value .includes (NO_DEPENDENCY_ID ),
63+ () => packages .value .length < MAX_PACKAGE_SELECTION && ! packages .value .includes (NO_DEPENDENCY_ID ),
6564)
6665
6766// Add "no dependency" column to comparison
6867function addNoDep() {
69- if (packages .value .length >= maxPackages ) return
68+ if (packages .value .length >= MAX_PACKAGE_SELECTION ) return
7069 if (packages .value .includes (NO_DEPENDENCY_ID )) return
7170 packages .value = [... packages .value , NO_DEPENDENCY_ID ]
7271}
@@ -183,7 +182,7 @@ useSeoMeta({
183182 <h2 id =" packages-heading" class =" text-xs text-fg-subtle uppercase tracking-wider mb-3" >
184183 {{ $t('compare.packages.section_packages') }}
185184 </h2 >
186- <ComparePackageSelector v-model =" packages" :max =" maxPackages " />
185+ <ComparePackageSelector v-model =" packages" :max =" MAX_PACKAGE_SELECTION " />
187186
188187 <!-- "No dep" replacement suggestions (native, simple) -->
189188 <div v-if =" noDepSuggestions.length > 0" class =" mt-3 space-y-2" >
0 commit comments