File tree Expand file tree Collapse file tree 5 files changed +24
-24
lines changed
Expand file tree Collapse file tree 5 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 2121 window . DEPLOY_URL = ''
2222 window . process = { env : { } }
2323 </ script >
24- < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/@docsearch/css@3 "/>
2524 </ head >
2625
2726 < body class ="of-hidden ">
2827 < div id ="header "> </ div >
2928 < app-root > </ app-root >
3029 < 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 >
4231 <!-- prettier-ignore -->
4332 < script id ="tinyui-design-common " src ="/static/js/design-common.js "> </ script >
4433 < script type ="module " src ="./src/main.js "> </ script >
Original file line number Diff line number Diff line change 11{
22 "name" : " @opentiny/vue-docs" ,
3- "version" : " 3.20.2 " ,
3+ "version" : " 3.20.3 " ,
44 "license" : " MIT" ,
55 "scripts" : {
66 "start" : " vite" ,
4747 "tailwindcss" : " ^3.2.4" ,
4848 "vue" : " ^3.4.31" ,
4949 "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"
5153 },
5254 "devDependencies" : {
5355 "@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'
1717import { appData } from ' ./tools'
1818import useTheme from ' ./tools/useTheme'
1919
20- const envTarget = import .meta.env.VITE_BUILD_TARGET || ' open'
21-
2220export default defineComponent ({
2321 name: ' AppVue' ,
2422 props: [],
@@ -42,11 +40,6 @@ export default defineComponent({
4240 }
4341 })
4442 common .renderHeader ()
45-
46- const searchBox = document .querySelector (' .search-box' )
47- if (searchBox && envTarget === ' open' ) {
48- searchBox .style .display = ' block'
49- }
5043 })
5144 const { designConfig , currentThemeKey } = useTheme ()
5245
Original file line number Diff line number Diff line change @@ -31,11 +31,25 @@ import hljs from 'highlight.js/lib/core'
3131import javascript from 'highlight.js/lib/languages/javascript'
3232import css from 'highlight.js/lib/languages/css'
3333import 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'
3438
3539hljs . registerLanguage ( 'javascript' , javascript )
3640hljs . registerLanguage ( 'css' , css )
3741hljs . registerLanguage ( 'html' , html )
3842
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+
3953// 实验后发现,先调用一次预热一下,后续再调用会有速度的提示,因此在main中预热一下。
4054setTimeout ( ( ) => {
4155 hljs . highlightAuto ( `<template>
Original file line number Diff line number Diff line change 44}
55
66/* reset.css 引入后造成site官网中 b 和 strong 标签没有粗体,此处还原粗体 */
7- b , strong {
7+ b ,
8+ strong {
89 font-weight : 700 ;
910}
1011
@@ -22,7 +23,8 @@ b, strong {
2223 z-index : 1000 !important ;
2324}
2425
25- .tiny-grid td , .tiny-grid th {
26+ .tiny-grid td ,
27+ .tiny-grid th {
2628 vertical-align : middle;
2729}
2830
@@ -42,7 +44,7 @@ b, strong {
4244
4345.DocSearch-Button {
4446 border-radius : 6px ;
45- transition : 0.4s
47+ transition : 0.4s ;
4648}
4749
4850.DocSearch-Button : hover {
You can’t perform that action at this time.
0 commit comments