Skip to content

Commit

Permalink
fix(theme): watch for changes in props.collapsed (#809) (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored Jun 18, 2022
1 parent 107724a commit 7737699
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client/theme-default/components/VPSidebarGroup.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { DefaultTheme } from 'vitepress/theme'
import { ref } from 'vue'
import { ref, watchEffect } from 'vue'
import VPIconPlusSquare from './icons/VPIconPlusSquare.vue'
import VPIconMinusSquare from './icons/VPIconMinusSquare.vue'
import VPSidebarLink from './VPSidebarLink.vue'
Expand All @@ -12,7 +12,10 @@ const props = defineProps<{
collapsed?: boolean
}>()
const collapsed = ref(props.collapsible && props.collapsed)
const collapsed = ref(false)
watchEffect(() => {
collapsed.value = !!(props.collapsible && props.collapsed)
})
function toggle() {
if (props.collapsible) {
Expand Down

0 comments on commit 7737699

Please sign in to comment.