@@ -8,17 +8,10 @@ import { CSSTransition } from 'react-transition-group'
8
8
import Search from '../search/search'
9
9
import {
10
10
SiteReactTaro ,
11
- header ,
12
- versions ,
13
11
nav ,
14
12
repository ,
15
- language ,
16
- guide as vueGuide ,
17
13
reactGuide ,
18
- reactTaroGuide ,
19
14
moreGuide ,
20
- businessGuide ,
21
- products ,
22
15
} from '../../../../config/index'
23
16
const Header = ( ) => {
24
17
const navigate = useNavigate ( )
@@ -87,33 +80,39 @@ const Header = () => {
87
80
const headerBck = SiteReactTaro . header
88
81
const [ isShowGuid , setIsShowGuid ] = useState ( false )
89
82
const [ isShowGuid4 , setIsShowGuid4 ] = useState ( false )
90
- const [ selectedVersion , setSelectedVersion ] = useState ( '3.0.0-beta.11' )
83
+ const [ selectedVersion , setSelectedVersion ] = useState ( version )
91
84
const [ selectedLanguage , setSelectedLanguage ] = useState ( '' )
92
85
const handleMouseHover = ( isHovered ) => {
93
86
setIsShowGuid ( isHovered )
94
87
}
95
88
useEffect ( ( ) => {
96
- if ( location . pathname . includes ( '/component' ) ) {
89
+ if ( location . pathname . includes ( '/component' ) ) {
97
90
setActiveLink ( '组件' )
98
91
}
99
92
} , [ location ] )
100
93
const toAnother = ( ) => {
101
94
// 开发环境
102
- if ( process . env . NODE_ENV === 'development' ) {
103
- if ( window . location . href . includes ( '/react/#' ) ) {
104
- window . location . href = window . location . href . replace ( '/react/#' , '/react/index.taro.html#' ) ;
95
+ if ( process . env . NODE_ENV === 'development' ) {
96
+ if ( window . location . href . includes ( '/react/#' ) ) {
97
+ window . location . href = window . location . href . replace (
98
+ '/react/#' ,
99
+ '/react/index.taro.html#'
100
+ )
105
101
} else if ( window . location . href . includes ( '/react/index.taro.html#' ) ) {
106
- window . location . href = window . location . href . replace ( '/react/index.taro.html#' , '/react/#' ) ;
102
+ window . location . href = window . location . href . replace (
103
+ '/react/index.taro.html#' ,
104
+ '/react/#'
105
+ )
107
106
}
108
107
return
109
108
}
110
109
// 生产环境
111
110
if ( window . location . href . includes ( 'taro' ) ) {
112
- window . location . href = window . location . href . replace ( 'taro' , 'h5' ) ;
111
+ window . location . href = window . location . href . replace ( 'taro' , 'h5' )
113
112
} else if ( window . location . href . includes ( 'h5' ) ) {
114
- window . location . href = window . location . href . replace ( 'h5' , 'taro' ) ;
113
+ window . location . href = window . location . href . replace ( 'h5' , 'taro' )
115
114
}
116
- } ;
115
+ }
117
116
const checkGuidTheme = ( item : any , type : string ) => {
118
117
setIsShowGuid ( false )
119
118
window . open ( item . link )
0 commit comments