mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
index button highlight
This commit is contained in:
parent
dd0ad7731b
commit
255d892177
1 changed files with 6 additions and 2 deletions
|
@ -4,7 +4,11 @@ import tabs from '../data/tabs.json'
|
||||||
import constants from '../constants.json'
|
import constants from '../constants.json'
|
||||||
|
|
||||||
export default function Layout (props) {
|
export default function Layout (props) {
|
||||||
const { route } = props
|
let href = props.route
|
||||||
|
|
||||||
|
if (href === '/' || href === '') {
|
||||||
|
href = 'index'
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -24,7 +28,7 @@ export default function Layout (props) {
|
||||||
return (
|
return (
|
||||||
<Link href={item.href} key={key} >
|
<Link href={item.href} key={key} >
|
||||||
<a
|
<a
|
||||||
className={route.includes(key) ? 'active' : ''}
|
className={href.includes(key) ? 'active' : ''}
|
||||||
>{item.text}</a>
|
>{item.text}</a>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue