File tree 5 files changed +24
-24
lines changed
5 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 21
21
window . DEPLOY_URL = ''
22
22
window . process = { env : { } }
23
23
</ script >
24
- < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/@docsearch/css@3 "/>
25
24
</ head >
26
25
27
26
< body class ="of-hidden ">
28
27
< div id ="header "> </ div >
29
28
< app-root > </ app-root >
30
29
< div id ="app " class ="wp100 hp100 pt60 of-hidden "> </ div >
31
- < div class ="search-box " style ="display: none; "> </ div >
32
- < script src ="https://cdn.jsdelivr.net/npm/@docsearch/js@3 "> </ script >
33
- < script type ="text/javascript ">
34
- docsearch ( {
35
- appId : "AGPA5UXHMH" ,
36
- apiKey : "5fa09fc20270efa61d68e2c2eb0f56df" ,
37
- indexName : "opentiny" ,
38
- container : ".search-box" ,
39
- debug : false
40
- } ) ;
41
- </ script >
30
+ < div class ="search-box "> </ div >
42
31
<!-- prettier-ignore -->
43
32
< script id ="tinyui-design-common " src ="/static/js/design-common.js "> </ script >
44
33
< script type ="module " src ="./src/main.js "> </ script >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @opentiny/vue-docs" ,
3
- "version" : " 3.20.2 " ,
3
+ "version" : " 3.20.3 " ,
4
4
"license" : " MIT" ,
5
5
"scripts" : {
6
6
"start" : " vite" ,
47
47
"tailwindcss" : " ^3.2.4" ,
48
48
"vue" : " ^3.4.31" ,
49
49
"vue-i18n" : " ^9.1.10" ,
50
- "vue-router" : " 4.1.5"
50
+ "vue-router" : " 4.1.5" ,
51
+ "@docsearch/js" : " ^3.8.0" ,
52
+ "@docsearch/css" : " ^3.8.0"
51
53
},
52
54
"devDependencies" : {
53
55
"@opentiny-internal/unplugin-virtual-template" : " workspace:~" ,
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ import { iconClose } from '@opentiny/vue-icon'
17
17
import { appData } from ' ./tools'
18
18
import useTheme from ' ./tools/useTheme'
19
19
20
- const envTarget = import .meta.env.VITE_BUILD_TARGET || ' open'
21
-
22
20
export default defineComponent ({
23
21
name: ' AppVue' ,
24
22
props: [],
@@ -42,11 +40,6 @@ export default defineComponent({
42
40
}
43
41
})
44
42
common .renderHeader ()
45
-
46
- const searchBox = document .querySelector (' .search-box' )
47
- if (searchBox && envTarget === ' open' ) {
48
- searchBox .style .display = ' block'
49
- }
50
43
})
51
44
const { designConfig , currentThemeKey } = useTheme ()
52
45
Original file line number Diff line number Diff line change @@ -31,11 +31,25 @@ import hljs from 'highlight.js/lib/core'
31
31
import javascript from 'highlight.js/lib/languages/javascript'
32
32
import css from 'highlight.js/lib/languages/css'
33
33
import html from 'highlight.js/lib/languages/xml'
34
+ import docsearch from '@docsearch/js'
35
+ import '@docsearch/css'
36
+
37
+ const envTarget = import . meta. env . VITE_BUILD_TARGET || 'open'
34
38
35
39
hljs . registerLanguage ( 'javascript' , javascript )
36
40
hljs . registerLanguage ( 'css' , css )
37
41
hljs . registerLanguage ( 'html' , html )
38
42
43
+ if ( envTarget === 'open' ) {
44
+ docsearch ( {
45
+ appId : 'AGPA5UXHMH' ,
46
+ apiKey : '5fa09fc20270efa61d68e2c2eb0f56df' ,
47
+ indexName : 'opentiny' ,
48
+ container : '.search-box' ,
49
+ debug : false
50
+ } )
51
+ }
52
+
39
53
// 实验后发现,先调用一次预热一下,后续再调用会有速度的提示,因此在main中预热一下。
40
54
setTimeout ( ( ) => {
41
55
hljs . highlightAuto ( `<template>
Original file line number Diff line number Diff line change 4
4
}
5
5
6
6
/* reset.css 引入后造成site官网中 b 和 strong 标签没有粗体,此处还原粗体 */
7
- b , strong {
7
+ b ,
8
+ strong {
8
9
font-weight : 700 ;
9
10
}
10
11
@@ -22,7 +23,8 @@ b, strong {
22
23
z-index : 1000 !important ;
23
24
}
24
25
25
- .tiny-grid td , .tiny-grid th {
26
+ .tiny-grid td ,
27
+ .tiny-grid th {
26
28
vertical-align : middle;
27
29
}
28
30
@@ -42,7 +44,7 @@ b, strong {
42
44
43
45
.DocSearch-Button {
44
46
border-radius : 6px ;
45
- transition : 0.4s
47
+ transition : 0.4s ;
46
48
}
47
49
48
50
.DocSearch-Button : hover {
You can’t perform that action at this time.
0 commit comments