File tree Expand file tree Collapse file tree 2 files changed +17
-24
lines changed
packages/nuxt/client/components/devtools Expand file tree Collapse file tree 2 files changed +17
-24
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const props = defineProps<{
88 selected? : boolean
99}>()
1010
11- const cacheCount = computed (() => Object .keys (props .state [props .collection .name ] ?? {}).length )
11+ const cacheCount = computed (() => Object .keys (props .state ?. [props .collection .name ] ?? {}).length )
1212 </script >
1313
1414<template >
Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ const props = defineProps<{
88const { cache } = useStoreCache ()
99
1010const cacheCount = computed (() => Object .keys ((cache .value as any )[props .item .name ] ?? {}).length )
11+
12+ const tab = useLocalStorage (' rstore-devtools-tab' , ' 0' )
13+ const selectedCollection = useLocalStorage <string | null >(' rstore-devtools-selected-cache-collection' , null )
14+
15+ function goToCache() {
16+ selectedCollection .value = props .item .name
17+ tab .value = ' 1'
18+ }
1119 </script >
1220
1321<template >
@@ -21,29 +29,14 @@ const cacheCount = computed(() => Object.keys((cache.value as any)[props.item.na
2129 {{ item.name }}
2230 </div >
2331
24- <UPopover
25- arrow
26- >
27- <template #default =" { open } " >
28- <UBadge
29- :label =" cacheCount || '0'"
30- variant =" subtle"
31- :color =" cacheCount ? 'primary' : 'neutral'"
32- icon =" lucide:database"
33- :class =" {
34- 'ring ring-green-500': open,
35- 'font-bold': cacheCount > 0,
36- }"
37- />
38- </template >
39-
40- <template #content >
41- <CodeSnippet
42- :code =" (cache as any)[props.item.name] ?? {}"
43- class =" text-xs p-2 max-w-120 max-h-90 overflow-auto"
44- />
45- </template >
46- </UPopover >
32+ <UButton
33+ :label =" String(cacheCount) || '0'"
34+ variant =" subtle"
35+ :color =" cacheCount ? 'primary' : 'neutral'"
36+ size =" xs"
37+ icon =" lucide:database"
38+ @click =" goToCache()"
39+ />
4740 </div >
4841
4942 <div class =" text-xs font-mono border border-default rounded p-2 flex gap-4" >
You can’t perform that action at this time.
0 commit comments