Skip to content

Commit 4d3ef43

Browse files
committed
perf(package-playgrounds): use shallowRef instead deep ref
1 parent 70affdc commit 4d3ef43

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

app/components/PackagePlaygrounds.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import { onClickOutside } from '@vueuse/core'
32
import type { PlaygroundLink } from '#shared/types'
43
54
const props = defineProps<{
@@ -41,10 +40,10 @@ function getColor(provider: string): string {
4140
}
4241
4342
// Dropdown state
44-
const isOpen = ref(false)
45-
const dropdownRef = ref<HTMLElement>()
46-
const menuRef = ref<HTMLElement>()
47-
const focusedIndex = ref(-1)
43+
const isOpen = shallowRef(false)
44+
const dropdownRef = useTemplateRef('dropdownRef')
45+
const menuRef = useTemplateRef('menuRef')
46+
const focusedIndex = shallowRef(-1)
4847
4948
onClickOutside(dropdownRef, () => {
5049
isOpen.value = false

0 commit comments

Comments
 (0)