File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
.vitepress/theme/components Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { VTSwitch , VTIconChevronDown } from ' @vue/theme'
33import { useRoute } from ' vitepress'
4- import { ref , computed , inject , Ref } from ' vue'
4+ import { inject , Ref } from ' vue'
55import {
66 preferCompositionKey ,
77 preferComposition ,
@@ -10,20 +10,15 @@ import {
1010} from ' ./preferences'
1111
1212const route = useRoute ()
13- const show = computed (() =>
13+ const show = $ computed (() =>
1414 / ^ \/ (guide| tutorial| examples)\/ / .test (route .path )
1515)
16- const showSFC = computed (() => ! / ^ \/ guide/ .test (route .path ))
16+ const showSFC = $ computed (() => ! / ^ \/ guide/ .test (route .path ))
1717
18- const isOpenKey = ' keep-preference-open'
19- const persistedOpenState =
20- typeof localStorage !== ' undefined' && localStorage .getItem (isOpenKey )
21- const isOpen = ref (
22- persistedOpenState ? JSON .parse (persistedOpenState ) : true
23- )
18+ let isOpen = $ref (true )
2419
2520const toggleOpen = () => {
26- localStorage . setItem ( isOpenKey , String (( isOpen . value = ! isOpen . value )))
21+ isOpen = ! isOpen
2722}
2823
2924const removeOutline = (e : Event ) => {
You can’t perform that action at this time.
0 commit comments