Commit 07b73b7 1 parent cfcb540 commit 07b73b7 Copy full SHA for 07b73b7
File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const VPAlgoliaSearchBox = defineAsyncComponent(
12
12
// to avoid loading the docsearch js upfront (which is more than 1/3 of the
13
13
// payload), we delay initializing it until the user has actually clicked or
14
14
// hit the hotkey to invoke it
15
+ const started = ref (false )
15
16
const loaded = ref (false )
16
17
const metaKey = ref (' Meta' )
17
18
@@ -37,16 +38,16 @@ onMounted(() => {
37
38
})
38
39
39
40
function load() {
40
- if (! loaded .value ) {
41
- loaded .value = true
41
+ if (! started .value ) {
42
+ started .value = true
42
43
}
43
44
}
44
45
</script >
45
46
46
47
<template >
47
48
<div v-if =" config.algolia" class =" VPNavBarSearch" >
48
- <VPAlgoliaSearchBox v-if =" loaded" />
49
- <div v-else id =" docsearch" @click =" load" >
49
+ <VPAlgoliaSearchBox v-if =" started " @vue:mounted = " loaded = true " />
50
+ <div v-if = " !loaded " id =" docsearch" @click =" load" >
50
51
<button
51
52
type =" button"
52
53
class =" DocSearch DocSearch-Button"
You can’t perform that action at this time.
0 commit comments