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 1
1
<script setup lang="ts">
2
2
import { VTSwitch , VTIconChevronDown } from ' @vue/theme'
3
3
import { useRoute } from ' vitepress'
4
- import { ref , computed , inject , Ref } from ' vue'
4
+ import { inject , Ref } from ' vue'
5
5
import {
6
6
preferCompositionKey ,
7
7
preferComposition ,
@@ -10,20 +10,15 @@ import {
10
10
} from ' ./preferences'
11
11
12
12
const route = useRoute ()
13
- const show = computed (() =>
13
+ const show = $ computed (() =>
14
14
/ ^ \/ (guide| tutorial| examples)\/ / .test (route .path )
15
15
)
16
- const showSFC = computed (() => ! / ^ \/ guide/ .test (route .path ))
16
+ const showSFC = $ computed (() => ! / ^ \/ guide/ .test (route .path ))
17
17
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 )
24
19
25
20
const toggleOpen = () => {
26
- localStorage . setItem ( isOpenKey , String (( isOpen . value = ! isOpen . value )))
21
+ isOpen = ! isOpen
27
22
}
28
23
29
24
const removeOutline = (e : Event ) => {
You can’t perform that action at this time.
0 commit comments