Skip to content

Commit

Permalink
fix: dongtai_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangAhua committed Sep 13, 2023
1 parent 3992b4e commit 8306c28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/SelectNav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default function SelectNav({ label, items }) {
let history = useHistory();
let pathname = useLocation().pathname;
let dongtai = pathname.startsWith('/doc/')
let cur = pathname.replace(dongtai ? '/dongtai_doc/' : '/docs/', '').split('/')[0]
let cur = pathname.replace(dongtai ? '/dongtai_doc/docs/' : '/docs/', '').split('/')[0]
let flag = cur === 'next' || versionsList.includes(cur)
let pagePath = flag ? pathname.replace(dongtai ? `/dongtai_doc/${cur}` : `/docs/${cur}`, '') : pathname.replace(dongtai ? '/dongtai_doc' : '/docs', '')
let pagePath = flag ? pathname.replace(dongtai ? `/dongtai_doc/docs/${cur}` : `/docs/${cur}`, '') : pathname.replace(dongtai ? '/dongtai_doc/docs' : '/docs', '')
console.log('----', pathname, pagePath)
const [selectedOption, setSelectedOption] = flag ? useState(cur === 'next' ? 'Next' : cur) : useState(items[1].label);
const [showDropdown, setShowDropdown] = useState(false);
Expand Down

0 comments on commit 8306c28

Please sign in to comment.