File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,25 @@ const highlightedIndex = shallowRef(-1)
2323const dropdownPosition = shallowRef <{ top: number ; left: number } | null >(null )
2424
2525const menuId = ' download-menu'
26- const menuItems = computed (() => [
27- { id: ' package' , icon: ' i-lucide:package' , disabled: false },
28- {
29- id: ' dependencies' ,
30- icon: props .dependenciesLoading ? ' i-lucide:loader-circle' : ' i-lucide:list-tree' ,
31- disabled: props .dependenciesLoading || ! props .dependencies ?.length ,
32- },
33- ])
26+ const menuItems = computed (() => {
27+ const items: { id: string ; icon: string ; disabled: boolean }[] = [
28+ { id: ' package' , icon: ' i-lucide:package' , disabled: false },
29+ ]
30+ if (props .dependenciesLoading ) {
31+ items .push ({
32+ id: ' dependencies' ,
33+ icon: ' i-lucide:loader-circle' ,
34+ disabled: true ,
35+ })
36+ } else if (props .dependencies ?.length ) {
37+ items .push ({
38+ id: ' dependencies' ,
39+ icon: ' i-lucide:list-tree' ,
40+ disabled: false ,
41+ })
42+ }
43+ return items
44+ })
3445
3546const prefersReducedMotion = useMediaQuery (' (prefers-reduced-motion: reduce)' )
3647
You can’t perform that action at this time.
0 commit comments