We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecac34b commit fc59eaeCopy full SHA for fc59eae
src/.vitepress/theme/components/PreferenceSwitch.vue
@@ -11,7 +11,10 @@ import {
11
12
const route = useRoute()
13
const show = computed(() => /^\/(guide|tutorial|examples)\//.test(route.path))
14
-const isOpen = ref(false)
+const isOpen = ref(
15
+ typeof localStorage !== 'undefined' &&
16
+ !localStorage.getItem(preferCompositionKey)
17
+)
18
19
const toggleOpen = () => (isOpen.value = !isOpen.value)
20
const toggleCompositionAPI = useToggleFn(
@@ -218,7 +221,8 @@ function useToggleFn(
218
221
transform: translateX(18px);
219
222
}
220
223
-.tip .options-api, .tip .composition-api {
224
+.tip .options-api,
225
+.tip .composition-api {
226
color: var(--vt-c-text-code);
227
transition: color 0.5s;
228
font-weight: 600;
0 commit comments