Skip to content

Commit 940c1f0

Browse files
committed
chore: update selected version
1 parent 95bed62 commit 940c1f0

File tree

1 file changed

+15
-16
lines changed
  • src/sites/sites-react/doc/components/header

1 file changed

+15
-16
lines changed

src/sites/sites-react/doc/components/header/header.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@ import { CSSTransition } from 'react-transition-group'
88
import Search from '../search/search'
99
import {
1010
SiteReactTaro,
11-
header,
12-
versions,
1311
nav,
1412
repository,
15-
language,
16-
guide as vueGuide,
1713
reactGuide,
18-
reactTaroGuide,
1914
moreGuide,
20-
businessGuide,
21-
products,
2215
} from '../../../../config/index'
2316
const Header = () => {
2417
const navigate = useNavigate()
@@ -87,33 +80,39 @@ const Header = () => {
8780
const headerBck = SiteReactTaro.header
8881
const [isShowGuid, setIsShowGuid] = useState(false)
8982
const [isShowGuid4, setIsShowGuid4] = useState(false)
90-
const [selectedVersion, setSelectedVersion] = useState('3.0.0-beta.11')
83+
const [selectedVersion, setSelectedVersion] = useState(version)
9184
const [selectedLanguage, setSelectedLanguage] = useState('')
9285
const handleMouseHover = (isHovered) => {
9386
setIsShowGuid(isHovered)
9487
}
9588
useEffect(() => {
96-
if(location.pathname.includes('/component')) {
89+
if (location.pathname.includes('/component')) {
9790
setActiveLink('组件')
9891
}
9992
}, [location])
10093
const toAnother = () => {
10194
// 开发环境
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+
)
105101
} 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+
)
107106
}
108107
return
109108
}
110109
// 生产环境
111110
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')
113112
} 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')
115114
}
116-
};
115+
}
117116
const checkGuidTheme = (item: any, type: string) => {
118117
setIsShowGuid(false)
119118
window.open(item.link)

0 commit comments

Comments
 (0)